2
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 way of study I need the 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
.
Give a check if the Telerik help you.
– Mathiasfc
Even if you are trying to convert from this site, the code shows an error. http://prntscr.com/f8i7aa
– Rickafds
This is not VB6.
– Jéf Bueno
Use
if
in everything that will work. And don’t put things that the original code doesn’t have. @Mathias?– Maniero