Click here to Skip to main content
15,894,313 members
Home / Discussions / C#
   

C#

 
AnswerRe: problem with saving a picture as an icon Pin
NassosReyzidis9-Dec-05 0:31
NassosReyzidis9-Dec-05 0:31 
QuestionLightweight Collections Pin
OldDog.Net8-Dec-05 8:09
OldDog.Net8-Dec-05 8:09 
AnswerRe: Lightweight Collections Pin
Dave Kreskowiak8-Dec-05 11:18
mveDave Kreskowiak8-Dec-05 11:18 
QuestionAsyncronous WebRequest (race condition) Pin
usernameexists8-Dec-05 7:15
usernameexists8-Dec-05 7:15 
QuestionWriting to webpage from C# Pin
monrobot138-Dec-05 7:12
monrobot138-Dec-05 7:12 
AnswerRe: Writing to webpage from C# Pin
Rob Philpott8-Dec-05 7:58
Rob Philpott8-Dec-05 7:58 
GeneralRe: Writing to webpage from C# Pin
monrobot138-Dec-05 8:50
monrobot138-Dec-05 8:50 
GeneralRe: Writing to webpage from C# Pin
Rob Philpott8-Dec-05 9:13
Rob Philpott8-Dec-05 9:13 
Hi again,

The first thing I'd do in tackling this problem is to see what the form the POST takes when you fill in the details on the webpage normally by hand and hit submit.

I'd recommend using the Microsoft Soap Toolkit Trace Utility for this http://www.microsoft.com/downloads/details.aspx?FamilyId=C943C0DD-CEEC-4088-9753-86F052EC8450&displaylang=en[^]

Fire this up and create a new trace. Put in the URL of the page you want to submit to, and leave the local port on 8080 and the external port on 80. Then point your browser at http://localhost:8080

This tool will allow you to see exactly what gets sent and what is recieved from the website (provided its not SSL secured). From playing around with this you should be able to determine exactly what to POST to the website to make it look like its just plain Internet Explorer etc. I find this is a damn handy thing to have around when web programming. Bear in mind that this is a bit like the old screen-scraping approach and if the website changes will probably break.

In your code create an instance of the HttpWebRequest class by calling its static Create() method passing in the url of the website. Set the Method property to "POST" and then use GetRequestStream() to get a stream to which you can feed your simulated data. Call GetResponse() to fire the data up to the website.

If you have problems with this I'll knock up a sample for you tomorrow.

Regards,
Rob Philpott.
GeneralRe: Writing to webpage from C# Pin
monrobot139-Dec-05 19:47
monrobot139-Dec-05 19:47 
GeneralRe: Writing to webpage from C# Pin
monrobot1310-Dec-05 20:17
monrobot1310-Dec-05 20:17 
GeneralRe: Writing to webpage from C# Pin
monrobot1310-Dec-05 20:46
monrobot1310-Dec-05 20:46 
AnswerRe: Writing to webpage from C# Pin
agileagent8-Dec-05 9:24
agileagent8-Dec-05 9:24 
QuestionBreak statement in C#. Pin
sacoskun8-Dec-05 6:47
sacoskun8-Dec-05 6:47 
AnswerRe: Break statement in C#. Pin
User 66588-Dec-05 7:00
User 66588-Dec-05 7:00 
GeneralRe: Break statement in C#. Pin
sacoskun8-Dec-05 7:05
sacoskun8-Dec-05 7:05 
GeneralRe: Break statement in C#. Pin
mav.northwind8-Dec-05 7:31
mav.northwind8-Dec-05 7:31 
JokeRe: Break statement in C#. Pin
akyriako788-Dec-05 7:42
akyriako788-Dec-05 7:42 
GeneralRe: Break statement in C#. Pin
Shawn Poulson8-Dec-05 8:24
Shawn Poulson8-Dec-05 8:24 
AnswerRe: Break statement in C#. Pin
agileagent8-Dec-05 10:02
agileagent8-Dec-05 10:02 
GeneralRe: Break statement in C#. Pin
sacoskun8-Dec-05 20:01
sacoskun8-Dec-05 20:01 
AnswerRe: Break statement in C#. Pin
Christian Graus8-Dec-05 10:08
protectorChristian Graus8-Dec-05 10:08 
GeneralRe: Break statement in C#. Pin
sacoskun8-Dec-05 20:08
sacoskun8-Dec-05 20:08 
QuestionMDI Menus Question Pin
akyriako788-Dec-05 6:02
akyriako788-Dec-05 6:02 
AnswerRe: MDI Menus Question Pin
akyriako788-Dec-05 6:12
akyriako788-Dec-05 6:12 
Questionapplication configuration file location Pin
rnvrnv8-Dec-05 5:22
rnvrnv8-Dec-05 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.