Skip to content

Commit

Permalink
Improve randorg interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
bethune-bryant committed Dec 28, 2017
1 parent 6cf068a commit 59ed825
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RandOrgInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ public static int RandInt(int min, int max)

string result = string.Empty;

WebRequest req = WebRequest.Create(url);
HttpWebRequest req = WebRequest.CreateHttp(url);
req.Timeout = 3000;
req.Accept = "text/html";
req.UserAgent = @"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36";
WebResponse res = req.GetResponse();
StreamReader reader = new StreamReader(res.GetResponseStream());
result = reader.ReadToEnd();
Expand Down

0 comments on commit 59ed825

Please sign in to comment.