Category: General

Connect to URL using Post

                String url = "http://URL.asp?message=" + message.ToString();

                using (WebClient client = new WebClient())
                {
                    //execute request and read response as string to console
                    using (StreamReader reader = new StreamReader(client.OpenRead(url)))
                    {
                        string s = reader.ReadToEnd();
                        Console.WriteLine(s);
                    }
                }

c#

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.