Setting the IP of connection C#

Total Post:134


 2198  View(s)
Rate this:
I have a web browser in my application and I want to change the IP of the incoming connection that's about to load the page. How would I set the connection's IP address? I've done it before in Java but I have no idea on how to do it in C#.
  1. Re: Setting the IP of connection C#

    Hi Tanuj,

    If you want to set the proxy address, you can do it on the WebRequest:

    using System;
    using System.IO;
    using System.Net;
    class Program
        static void Main(string[] args)
            WebRequest wr = WebRequest.Create("");
            WebProxy proxy = new WebProxy("http://localhost:8888");
            wr.Proxy = proxy;
            StreamReader sr = new StreamReader(wr.GetResponse().GetResponseStream());

      Modified On Apr-03-2018 06:18:47 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.