Visual Studio と C# を使用して、正規表現を使用してダウンロードした html の特定の文字列を解析し、プロキシを取得する最善の方法を教えてください。
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string stringVar { get; set; }
private void button1_Click(object sender, EventArgs e)
{
WebClient wc = new WebClient();
stringVar = wc.DownloadString("http://somewebsitewithproxies.com/");
// some regex operation on stringVar here perhaps?
textBox1.Text = // ???
}
}
}
私は正規表現を使用します:
\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}[:]\d{1,5}
変数「stringVar」を解析し、プロキシを textBox1 に設定したいと考えています。これは、ボタンのクリック全体で簡単に実行できますか?
前もって感謝します。