Ok,I am trying to compare two strings every 15 seconds and then update an info box.
Here is the code I have so far to get a text document from the web and store it into a string:
public String GetData(String url)
{
WebRequest request = WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
String data = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
return data;
}
And here is what I have with trying to compare the strings.
public void CompareStrings()
{
int x;
x = 1;
String data = GetData("http://xcastradio.com/stats/nowplaying.txt");
string savedData = data;
while (x > 0 && x < 100000001)
{
x++;
}
String data1 = GetData("http://xcastradio.com/stats/nowplaying.txt");
NowPlayingInfo1.Text = data;
NowPlaying np = new NowPlaying();
if (data1 != savedData)
{
NowPlayingInfo1.Text = data1;
np.Show(this);
}
}