public static byte[] getWebBinarywithTimeout(string address, short timeoutS) { var w = new myWebClient(); w.Timeout = timeoutS; { try { var ret = w.DownloadData(address); return(ret); } catch (Exception ex) { throw ex; } } }
public static string getWebRequestwithTimeout(string address, short timeoutS) { var w = new myWebClient(); w.Headers.Add("User-Agent", "Vivecraft Installer"); w.Timeout = timeoutS; w.Encoding = Encoding.UTF8; { try { var ret = w.DownloadString(address); return(ret); } catch (Exception ex) { throw ex; } } }