using System; using System.Net; namespace Custom_Installer { class Web { public Boolean CanDownload; WebClient Client; public Web() { Client = new WebClient(); try { String DownloadedString = Client.DownloadString(String.Format(Properties.Settings.Default.Server_URL, Properties.Settings.Default.Allowed_File)); CanDownload = Convert.ToBoolean(DownloadedString); if (!CanDownload) { Program.Message("{0} Are Doing Some Updates To The Client, You Cannot Download Right Now, Please Try Again Later, Thanks!", Properties.Settings.Default.Server_Name); Program.Shutdown(); } } catch { Program.Message("{0} Seems To Be Offline, You Cannot Install The Game At This Time!", Properties.Settings.Default.Server_Name); Program.Shutdown(); } } public Int64 FileSize() { Int64 Size = 0; try { WebRequest RequestSize = HttpWebRequest.Create(String.Format(Properties.Settings.Default.Server_URL, Properties.Settings.Default.Extract_Server_Name)); HttpWebResponse ResponseSize = (HttpWebResponse)RequestSize.GetResponse(); Size = ResponseSize.ContentLength; } catch { } return Size; } } }