您能帮我实现一个随机更改的代理系统吗? 我不知道该把手放在哪里!
Private Function Auth(user As String, password As String) As String
Dim ret = String.Empty
Try
Dim data = "Nothing for now"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data)
Dim webReq = DirectCast(WebRequest.Create(New Uri("Website")), HttpWebRequest)
webReq.Method = "POST"
webReq.ContentType = "application/json"
webReq.ContentLength = byteArray.Length
Dim newStream As Stream = webReq.GetRequestStream()
newStream.Write(byteArray, 0, byteArray.Length)
newStream.Close()
Dim response = DirectCast(webReq.GetResponse(), HttpWebResponse)
Dim sr = New StreamReader(response.GetResponseStream(), Encoding.[Default])
ret = sr.ReadToEnd()
sr.Close()
response.Close()
newStream.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Return ret
End Function