Login and Post in one C# program

B

Brian

Hello All,

I need some help for my auto-post C# program.
I tried to post something on my forum, but my forum need me to login first.
How could I keep the session information in two http connections?
In other words, I need to login at login url first, then post my message on
post url.
How to do?
Thanks.

Brian
 
A

alan.washington

I must say I am confused. Can you not just do both processes in the same event? For example,

1. Submit the form
2. login the user and get the userid
3. submit the post with the info from the form and the user id that you ust got.

Please post additional information and I can try and lend a hand.

Alan Washington
http://www.aewnet.com
Hello All,

I need some help for my auto-post C# program.
I tried to post something on my forum, but my forum need me to login first.
How could I keep the session information in two http connections?
In other words, I need to login at login url first, then post my message on
post url.
How to do?
Thanks.

Brian

User submitted from AEWNET (http://www.aewnet.com/)
 
B

Brian

Alan,

What I want to do are:

1. Login with my username and password at http://server/login.aspx
I can do it - it is very easy.
2. After login, post my messages into forum via
http://server/post_message.aspx
If I just send the subject and body of my message to post_message.aspx,
it will reject me and redirect me to login.aspx

So, how can I keep the session information (I don't know how does the server
name the key) and post my message?
In other words, how can my C# WinForm app emulate the actions of my posting
message by IE?
Right now I only can use IE browser to go to http://server/login.aspx first.
After login, go to http://server/post_message.aspx to post.

Thanks.

Brian
 
B

Brian

Alan,

What I want to do are:

1. Login with my username and password at http://server/login.aspx
I can do it - it is very easy.
2. After login, post my messages into forum via
http://server/post_message.aspx
If I just send the subject and body of my message to post_message.aspx,
it will reject me and redirect me to login.aspx

So, how can I keep the session information (I don't know how does the server
name the key) and post my message?
In other words, how can my C# WinForm app emulate the actions of my posting
message by IE?
Right now I only can use IE browser to go to http://server/login.aspx first.
After login, go to http://server/post_message.aspx to post.

Thanks.

Brian
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top