Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

NetworkCredential

Thread view: 
IveCal - 17 Apr 2006 05:03 GMT
Hello, guys... What is the Java equivalent class for NetworkCredential?
Please reply. Thanks
IveCal - 17 Apr 2006 05:09 GMT
NetworkCredential by that way is a C# class.
IveCal - 20 Apr 2006 07:52 GMT
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;
   }
Oliver Wong - 20 Apr 2006 15:42 GMT
> 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 - 17 Apr 2006 18:05 GMT
> Hello, guys... What is the Java equivalent class for NetworkCredential?
> Please reply. Thanks

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

   - Oliver
Roedy Green - 18 Apr 2006 00:24 GMT
>    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?
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Oliver Wong - 18 Apr 2006 14:29 GMT
>>    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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.