By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,132 Members | 1,417 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,132 IT Pros & Developers. It's quick & easy.

http sessions and .Net Windows Forms

P: n/a
Hi,

I want to run in my .Net Windows Form this statement

System.Diagnostics.Process.Start(strURLCommand)

to open the browser and navigate to the specified URL.

The URL is an ASP.Net Web Page with authentication
mode="Forms". In this way, the browser displaies the
authentication ASP.Net WEB page, every time the
application executes the statement.

I want to display the authentication page only the first
time.

Ho can I do?

Thank's
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Mark,

System.Diagnostics.Process.Start(strURLCommand)
the code line will open a new process every time you excute.
for the design by process, the http session is not same in two process.
If you want to do so, then the web sites must support cookie.
You may try to make a test by following the link below.
Forms Authentication Using An XML Users File
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconcookieauthenticationusinganxmlusersfile.asp
You may check Persistent Cookies: option in the example webpage in the link
above.
Then you may using the IE to open the website many times without login.

Did I misunderstand your meaning?
Can you tell me what aim do you want to achieve, so I can help you.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
Content-Class: urn:content-classes:message
From: "Mark" <In**@SIRIOInformatica.it>
Sender: "Mark" <In**@SIRIOInformatica.it>
Subject: http sessions and .Net Windows Forms
Date: Wed, 17 Sep 2003 08:25:58 -0700
Lines: 19
Message-ID: <04****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcN9L/6DqIUJl7YORoaLPmkKDzwEwQ==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:108843
NNTP-Posting-Host: TK2MSFTNGXA05 10.40.1.49
X-Tomcat-NG: microsoft.public.dotnet.general

Hi,

I want to run in my .Net Windows Form this statement

System.Diagnostics.Process.Start(strURLCommand)

to open the browser and navigate to the specified URL.

The URL is an ASP.Net Web Page with authentication
mode="Forms". In this way, the browser displaies the
authentication ASP.Net WEB page, every time the
application executes the statement.

I want to display the authentication page only the first
time.

Ho can I do?

Thank's


Jul 21 '05 #2

P: n/a
Thanks Peter for your answer.

The choice of persistent cookie is a good idea, even if this can, in
some way, to avoid the problem and not to resolve it. In truth I tried a
way in order to capture the session and to maintain it "while still
alive" the entire time necessary, also after the closing of the browser,
while mine .Net Windows Form is in execution. Although that, the
solution from suggested you, seems to be only the possible one.

Thanks newly

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3

P: n/a
Hi Mark,

Did you really need to use the code line?
System.Diagnostics.Process.Start(strURLCommand)

If no, you may try to automation InternetExplorer. Here is my code sample.

Make a reference to the Microsoft Internet Controls by opening add
reference dialog and selecting COM/Microsoft Internet Controls
SHDocVw.InternetExplorer ie;
private void button1_Click(object sender, System.EventArgs e)
{
ie = new SHDocVw.InternetExplorerClass();
ie.Visible=true;
object o = Missing.Value;
ie.Navigate("http://localhost/test/logon/default.aspx",ref o,ref o,ref
o,ref o);
}

private void button2_Click(object sender, System.EventArgs e)
{
object o = Missing.Value;
ie.Navigate("http://localhost/test/logon/srcview.aspx",ref o,ref o,ref
o,ref o);
//this one will not need to get authenticated again if you have gotten in
the last page.
}

Did this does the job for you?

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: Mark Mark <in**@sirioinformatica.it>
References: <nI**************@cpmsftngxa06.phx.gbl>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: RE: http sessions and .Net Windows Forms
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <e5*************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
Date: Wed, 17 Sep 2003 23:52:37 -0700
NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109000
X-Tomcat-NG: microsoft.public.dotnet.general

Thanks Peter for your answer.

The choice of persistent cookie is a good idea, even if this can, in
some way, to avoid the problem and not to resolve it. In truth I tried a
way in order to capture the session and to maintain it "while still
alive" the entire time necessary, also after the closing of the browser,
while mine .Net Windows Form is in execution. Although that, the
solution from suggested you, seems to be only the possible one.

Thanks newly

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 21 '05 #4

P: n/a
Hi,

I would not want to use the COM technology. My intention is that one to
produce .Net managed code.

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #5

P: n/a
Hi Mark,

Can you tell me what is aim of your project?
Or the cookie is the way your may need to use.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
From: Mark Mark <in**@sirioinformatica.it>
References: <HJ**************@cpmsftngxa06.phx.gbl>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: RE: http sessions and .Net Windows Forms
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <#W**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.general
Date: Thu, 18 Sep 2003 01:23:17 -0700
NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:109007
X-Tomcat-NG: microsoft.public.dotnet.general

Hi,

I would not want to use the COM technology. My intention is that one to
produce .Net managed code.

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.