Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Web App from WinForms client
Message
De
31/03/2005 14:12:09
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Accessing Web App from WinForms client
Divers
Thread ID:
01000426
Message ID:
01000426
Vues:
59
To all, thanks in advance for any ideas regarding this:

Using HttpWebRequest and HttpWebResponse objects, I access a web application from a WinForms application. I log in to the web application, and receive an authentication key (in the form of a cookie). I use the key in all subsequent HttpWebRequests to submit a query and receive the response as a web page (a report). The report has links in it that take the user to other more detailed reports. The links on this page are relative paths, so I convert them to absolute paths and save the page as a temporary html file on the workstation, and launch a browser to open and display the html file using System.Diagnostics.Process.Start().

Everything works fine up to this point. but I also want the user to be able click on links in this web page to navigate to details of the report. The user needs to pass his authentication KEY cookie back to the server to make any further requests of the web application. I tried inserting javascript in the temp html file to set a cookie (with document.cookie ="...") and it does seem to set the cookie because I can spit it back with a javascript alert(), but the server acts as if it isn't receiving the cookie and asks the user to log in. I also tried setting a cookie by putting a
<META HTTP-EQUIV="Set-Cookie" ... >
tag, with the same results. The browser just doesn't seem to be sending the cookie to the web server in the request when the user clicks on a link.

My question: Is what I'm doing fundamentally impossible, perhaps because the browser is opening a file from disk rather than receiving an HTTP response?

I'd be very grateful for any ideas

Thanks,

Keith Klein
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform