private void GetPassTest(int id, string lokal) { string filename = @"tmp\Spinningpass.html"; parser = new FSHtmlParser(); Pass pass = parser.ParsePass(File.ReadAllText(filename)); Trace.WriteLine("Pass: "******"i=" + i + "\t" + DateTime.Now); if (pass.Bokningar < pass.MaxBokningar) { Ledigtsignal(20); return; } System.Threading.Thread.Sleep(3000); } }
private Pass GetPass(int passid, string lokal) { WebRequest request = WebRequest.Create(string.Format(Passdetaljer, passid, lokal)); WebResponse response = request.GetResponse(); Stream stream = response.GetResponseStream(); StreamReader sr = new StreamReader(stream, Encoding.Default); string html = sr.ReadToEnd(); stream.Close(); return(parser.ParsePass(html)); }