Hello,
I am writing a program that makes use of random.org's random number generator, and one guideline from the site is "Configure your client to supply your email address in the User-Agent field of the request. That way, I can drop you a line if your client is causing trouble." How do I do this? This is what I have, it works fine, but I can't figure out how to put stuff in the "User-Agent" field.
This is my first time using http requests in programming, and i'm working mostly off examples, so please point out anything wrong or unnecessary.
This was supposed to be put in Visual Basic.NET, sorry.
I am writing a program that makes use of random.org's random number generator, and one guideline from the site is "Configure your client to supply your email address in the User-Agent field of the request. That way, I can drop you a line if your client is causing trouble." How do I do this? This is what I have, it works fine, but I can't figure out how to put stuff in the "User-Agent" field.
VB.NET:
Private Function HardwareStartNote() As Integer
Dim sURL As String
sURL = "http://www.random.org/integers/?num=1&min=0&max=11&col=1&base=10&format=plain&rnd=new"
Dim wrGETURL As WebRequest
wrGETURL = WebRequest.Create(sURL)
Dim objStream As Stream
objStream = wrGETURL.GetResponse.GetResponseStream()
Dim objReader As New StreamReader(objStream)
Dim sLine As String
sLine = objReader.ReadLine
Return sLine
End Function
This was supposed to be put in Visual Basic.NET, sorry.
Last edited: