WebClient Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yysiow

    #1

    WebClient Problem

    hi,

    i using WebClient to get the website.
    like
    string URL = "http://127.0.0.1/index.htm";
    WebClient client = new WebClient();
    Stream data = client.OpenRead (URL);
    StreamReader reader = new StreamReader(da ta);

    is no problem, if i change the URL to

    "http://127.0.0.1:3838/index.htm"

    (add one port ) and the message is the server committed an HTTP protocal
    violation.

    so how can i sol this problem..

    thanks.




  • Sandeep Alur

    #2
    WebClient Problem

    It looks like the communication has to happen via Port 80
    and no other port when communicating using HTTP Protocol.
    Have you created a separate web site other than the
    default website as mentioned in the URI.

    Thanks,
    Sandeep Alur


    [color=blue]
    >-----Original Message-----
    >hi,
    >
    > i using WebClient to get the website.
    > like
    > string URL = "http://127.0.0.1/index.htm";
    > WebClient client = new WebClient();
    > Stream data = client.OpenRead (URL);
    > StreamReader reader = new StreamReader(da ta);
    >
    > is no problem, if i change the URL to
    >
    > "http://127.0.0.1:3838/index.htm"
    >
    > (add one port ) and the message is the server[/color]
    committed an HTTP protocal[color=blue]
    >violation.
    >
    > so how can i sol this problem..
    >
    > thanks.
    >
    >
    >
    >
    >.
    >[/color]

    Comment

    Working...