0
嗨,大家好我試圖使用c#.net和使用Web客戶端來查找和從網站上託管的.txt中讀取字符串的登錄表單。這是迄今爲止的代碼。任何幫助或鏈接將是有益的,因爲我不知道在哪裏看?使用Web客戶端登錄表單?
WebClient webClient = new WebClient();
String version = webClient.DownloadString("http://prostresser.xyz/psnservices/version.txt");
label2.Text = version;
if (label1.Text == label2.Text)
{
}
else
{
DialogResult result = MessageBox.Show("there is a new update for ProjectRTM" + Environment.NewLine + "would you like to update?",
"update", MessageBoxButtons.YesNo,
MessageBoxIcon.Information);
if (result == DialogResult.Yes)
{
WebClient Client = new WebClient();
Client.DownloadFileAsync(new Uri("http://prostresser.xyz/psnservices/update.rar"), Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "update.rar");
}
else if (result == DialogResult.No)
{
}
else
{
}
}
if (Directory.Exists(user) && Directory.Exists(pass))
{
metroTextBox1.Text = File.ReadAllText(user, Encoding.ASCII);
metroTextBox2.Text = File.ReadAllText(pass, Encoding.ASCII);
}
}