Visual Studio Developer Center > Visual Studio Forums > Developer Documentation and Help System > How do I set the Local Port that my Net.WebClient() Uses ??
Ask a questionAsk a question
 

QuestionHow do I set the Local Port that my Net.WebClient() Uses ??

  • Friday, November 06, 2009 2:31 AMPasha Siraja Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello there, i don't know at what level this comes up but i am using WebClient for the first time.

    I want to access a file located on a server online, its a text file.

    The whole system works perfectly but the only problem is that the connections.

    WebClient locally opens a random port on my system like 2449, 1720, 5255, etc, as i said, its random,
    and it accesses port 80 to access the file.

    What i want to know is that if its possible to tell the webclient what port to open on my system, as i dont want random ports to be open on the firewall and want to setup the firewall to only open to port 80 for my application.

    thanx

    psj