I found this line of code:
Try
Dim WebReq As HttpWebRequest = HttpWebRequest.Create(GET_Data)
Using WebRes As HttpWebResponse = WebReq.GetResponse
Using Reader As New StreamReader(WebRes.GetResponseStream)
Dim Str As String = Reader.ReadLine
Select Case True
Case Str.Contains(Answer1)
Return "True"
Case Str.Contains(Answer2)
Return "Banned"
Case Str.Contains(Answer3)
Return "Invalid"
Case Else
Return "Invalid"
End Select
End Using
End Using
As a form of study I need this same code in C #
try
{
WebRequest WebReq = WebRequest.Create(Get_Data);
using (WebResponse WebRes = WebReq.GetResponse())
{
using (StreamReader Reader = new StreamReader(WebRes.GetResponseStream()))
{
string Str = Reader.ReadLine();
while (true)
{
if (Str.Contains(answer1).ToString()!= null)
{
MessageBox.Show("sadsads");
return "True";
}
}
}
}
}
I tried to use case, but it did not work, this was the last attempt with if
.