Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] data = Encoding.ASCII.GetBytes($"Identifier={"anyUsername"}&Password={"Password"}");
- WebRequest request = WebRequest.Create("http://users.tclnet.ir/Authentication/LogOn");
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = data.Length;
- using (Stream stream = request.GetRequestStream())
- {
- stream.Write(data, 0, data.Length);
- }
- string responseContent = null;
- using (WebResponse response = request.GetResponse())
- {
- using (Stream stream = response.GetResponseStream())
- {
- using (StreamReader sr99 = new StreamReader(stream))
- {
- responseContent = sr99.ReadToEnd();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement