załączone biblioteki
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Net;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;
using HtmlAgilityPack;
Kod
label1.Text = "1 USD";
List<string> kursy = new List<string>();
WebClient web = new WebClient();
string html = web.DownloadString("http://kursy-walut.mybank.pl/");
MatchCollection m1 = Regex.Matches(html, @"<td id=\"GBPPLN_NBP\">\\s*(.+?)\\s*</td>", RegexOptions.Singleline);
foreach (Match m in m1)
{
if (m.Groups[1].Value != "")
{
string kurs = m.Groups[1].Value;
kursy.Add(kurs);
}
}
listBox1.DataSource = kursy;
ktoś wie dlaczego linijka
MatchCollection m1 = Regex.Matches(html, @"<td id=\"GBPPLN_NBP\">\\s*(.+?)\\s*</td>", RegexOptions.Singleline);
wywala błąd:
Syntax error, ';' expected
The name 'GBPPLN_NBP' does not exist in the current context
Cannot resolve symbol 'GBPPLN_NBP'