Witam czy ktoś mógłby mi pomóc , rozpoczynam przygodę w c# , chciałbym się zalogować na stronę filebit.pl, mam kod ale nie jestem pewny czy dobrze napisany, pomóżcie
private void button1_Click(object sender, EventArgs e)
{
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "login=" + username;
postData += ("&password=" + password2);
byte[] data = encoding.GetBytes(postData);
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("http://filebit.pl");
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length; ;
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
}