Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
POSTing data to a webpage with a C# windows app
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Arc
17y
1.5k
1
Reply
Hey guys. I am trying to post a string to a webpage on my server, but I am not sure how to do it. I have tried peicing some code together from what I have read on the net, but I cannot find any real examples.
Has anyone done this?
Here is some crap code I am trying to get to work, but I am not realy sure what I am doing here since I have never done anything like this before.
[code]
string
sql =
"INSERT INTO tblWhatever (field1,field2) VALUES ('1','2')"
;
HttpWebRequest
myReq = (
HttpWebRequest
)
WebRequest
.Create(
"http://www.mywebsite.com/mypage.php"
);
myReq.Method =
"POST"
;
myReq.ContentType =
"application/x-www-form-urlencoded"
;
StreamWriter
writer =
new
StreamWriter
(myReq.GetRequestStream());
writer.Write(sql);
writer.Close();
[/code]
Thanks for any input!
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Double row tree view
customdictionary