NetworkCredential

Discussion in 'Java' started by IveCal, Apr 17, 2006.

  1. IveCal

    IveCal Guest

    Hello, guys... What is the Java equivalent class for NetworkCredential?
    Please reply. Thanks
    IveCal, Apr 17, 2006
    #1
    1. Advertising

  2. IveCal

    IveCal Guest

    NetworkCredential by that way is a C# class.
    IveCal, Apr 17, 2006
    #2
    1. Advertising

  3. IveCal

    Oliver Wong Guest

    Oliver Wong, Apr 17, 2006
    #3
  4. IveCal

    Roedy Green Guest

    On Mon, 17 Apr 2006 17:05:30 GMT, "Oliver Wong" <>
    wrote, quoted or indirectly quoted someone who said :

    > Crosspost; don't multipost:
    >http://www.cs.tut.fi/~jkorpela/usenet/xpost.html


    wasn't it you in that last post on the futility of making Internet
    requests?
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Apr 18, 2006
    #4
  5. IveCal

    Oliver Wong Guest

    "Roedy Green" <> wrote in
    message news:...
    > On Mon, 17 Apr 2006 17:05:30 GMT, "Oliver Wong" <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> Crosspost; don't multipost:
    >>http://www.cs.tut.fi/~jkorpela/usenet/xpost.html

    >
    > wasn't it you in that last post on the futility of making Internet
    > requests?


    Yes. I bet no matter how many times I post the above advice, we'll
    always see another user make another multipost.

    - Oliver
    Oliver Wong, Apr 18, 2006
    #5
  6. IveCal

    IveCal Guest

    The code snippet below shows the use of NetworkCredential...
    I'm curious over the object (networkCredential in this case) it creates
    because it was used once only for authentication purposes... (exactly
    before accessing the webpage...) Do you have any idea how is this going
    to be implemented in Java? Thanks...

    void Page_Load(Object sender, EventArgs e) {
    XmlDocument doc = new XmlDocument();
    NetworkCredential networkCredential = new
    NetworkCredential("username","password"); ==> THIS IS WHAT I MEAN...

    HttpWebRequest HttpWReq = (HttpWebRequest)WebRequest.Create(
    "http://api.keyworddiscovery.com/free.php?q="
    + HttpUtility.UrlEncode(Request.Form["query"])
    );
    HttpWReq.PreAuthenticate = true;

    HttpWReq.Credentials = networkCredential;

    HttpWebResponse HttpWResp =
    (HttpWebResponse)HttpWReq.GetResponse();

    if (HttpWResp.StatusCode == HttpStatusCode.OK) {
    doc.Load(HttpWResp.GetResponseStream());
    }

    XslTransform trans = new XslTransform();
    trans.Load(Server.MapPath("output_template.xsl"));

    xml1.Document = doc;
    xml1.Transform = trans;
    }
    IveCal, Apr 20, 2006
    #6
  7. IveCal

    Oliver Wong Guest

    "IveCal" <> wrote in message
    news:...
    > The code snippet below shows the use of NetworkCredential...


    To the OP:

    Did you read the link at http://www.cs.tut.fi/~jkorpela/usenet/xpost.html ?
    I posted an answer to you in another newsgroup already.

    To Roedy:

    I told you so.

    - Oliver
    Oliver Wong, Apr 20, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Douglas
    Replies:
    4
    Views:
    717
    Jay Douglas
    Mar 6, 2004
  2. =?Utf-8?B?WUs=?=
    Replies:
    3
    Views:
    5,042
    *Busy*
    Mar 24, 2010
  3. Replies:
    3
    Views:
    1,359
  4. wgo
    Replies:
    0
    Views:
    183
  5. sorpor
    Replies:
    3
    Views:
    222
    Paul Glavich [MVP - ASP.NET]
    May 4, 2004
Loading...

Share This Page