Ejemplo n.º 1
0
 /// <summary>
 /// Downloads the given type of file from our server and returns the path to the temp file.
 /// Please clean up the temp file once done.
 /// </summary>
 public static string DownloadFile(OurSiteFileKind fileType)
 {
     using (WebClient web_client = new WebClient())
     {
         web_client.Proxy = ConfigurationManager.Instance.Proxy;
         string temp_file = TempFile.GenerateTempFilename("tmp");
         web_client.DownloadFile(GetOurFileUrl(fileType), temp_file);
         return(temp_file);
     }
 }
Ejemplo n.º 2
0
        public static string GetOurFileUrl(OurSiteFileKind fileType)
        {
            switch (fileType)
            {
            case OurSiteFileKind.ClientVersion:
                return(GetDownloadWebsiteUrl() + "/Content/Client/ClientVersion.xml");

            case OurSiteFileKind.ClientSetup:
                return(GetDownloadWebsiteUrl() + "/Content/Client/setup.exe");

            default:
                throw new NotImplementedException();
            }
        }