public static async Task DownloadFileExample()
        {
            // first we need to locate a node
            const int telematicsNodeID = 0;

            // Then we can get that node's file listing
            GetTelematicsNodeFilesResponse fileResponse = await DataExchangeAPI.GetTelematicsNodeFiles(telematicsNodeID);

            if (fileResponse.Success)
            {
                // Now we can download that file using the ID
                string   fileID   = fileResponse.Data[0].ID;
                FileInfo fileInfo = await DataExchangeAPI.GetDownloadFilesWithoutConversion(telematicsNodeID, fileID);

                if (fileInfo.Exists)
                {
                    ProcessStartInfo startInfo = new ProcessStartInfo
                    {
                        Arguments = fileInfo.Directory.FullName,
                        FileName  = fileInfo.Name
                    };

                    Process.Start(startInfo);
                }
            }

            await Task.CompletedTask;
        }
Exemple #2
0
        public static async Task <FileInfo> DownloadFileExample(string fileId)
        {
            TelematicsV2 telematicsV2 = new TelematicsV2(publicKey, privateKey, userKey);
            FileInfo     fileInfo     = await telematicsV2.GetDownloadFilesWithoutConversion(telematicsNode, fileId);

            return(fileInfo);
        }