Question Problem with Session variable / cookies.

WeeSean

New member
Joined
Aug 25, 2010
Messages
2
Programming Experience
1-3
I'm trying to write a console app in VS2010/.NET4 that connects to a web service but I'm having a problem with the Session variable.

I've already tested connecting to the web service with a ASP.NET web page with this,

Imports System.Net

Dim PMS as New PM1.PWSService ' PM1 added as Web Reference.
Dim cookiejar As CookieContainer ' to save session
If IsNothing(Session("CookieJar")) Then
cookiejar = New CookieContainer​
Else
cookiejar = Session("CookieJar")​
End If
PMS.login(user, pass)​
This works fine but this job will need to runs as a command line tool.
When I try to write this out in a console app project, Session is showing as not declared.
I've tried to import System.Web but all VS2010 gives me is AspNetHostingPerm... And {}Services (no httpcontext).

Any help appreciated.
Cheers
Seán.
 
Back
Top