Click here to Skip to main content
15,881,803 members
Home / Discussions / C#
   

C#

 
Questionmaking ranges of numeric data using 2d array in c# Pin
asna amlik3-Aug-09 19:56
asna amlik3-Aug-09 19:56 
AnswerRe: making ranges of numeric data using 2d array in c# Pin
SeMartens3-Aug-09 20:50
SeMartens3-Aug-09 20:50 
QuestionDuring installation of a setup build in vs2005, what are the things happened in registry entry? Pin
svt gdwl3-Aug-09 18:49
svt gdwl3-Aug-09 18:49 
AnswerRe: During installation of a setup build in vs2005, what are the things happened in registry entry? Pin
N a v a n e e t h3-Aug-09 18:57
N a v a n e e t h3-Aug-09 18:57 
AnswerRe: During installation of a setup build in vs2005, what are the things happened in registry entry? Pin
Toshiya TSURU3-Aug-09 19:40
Toshiya TSURU3-Aug-09 19:40 
Question[Message Deleted] Pin
haleemasher3-Aug-09 18:35
haleemasher3-Aug-09 18:35 
AnswerRe: does not contain definition for row index Pin
N a v a n e e t h3-Aug-09 19:01
N a v a n e e t h3-Aug-09 19:01 
QuestionWindows Application to do HTTP Post Pin
excellence803-Aug-09 17:52
excellence803-Aug-09 17:52 
Hi,

I need some help. Basically I have a simple HTML form like this:

<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<html><br />
<head><br />
<title>Wap Push Test</title><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
</head><br />
<body><br />
<form name="form1" action="http://111.111.111.111/app" method="post"><br />
xmldata:<br><br />
<br />
<textarea name="xmldata" cols="70" rows="30"><br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<PUSH><br />
<UID>myid</UID><br />
<PWD>thepassword</PWD><br />
<CONTENT TYPE="binary"><br />
The content here...<br />
</CONTENT><br />
<DCS>245</DCS><br />
<UDHL>7</UDHL><br />
</PUSH><br />
<br />
</textarea><br />
<br><br />
<input name="" type="submit" value="Push"><br />
</form><br />
</body><br />
</html><br />


Simply, it's only posting the XML to the destination web application. And it's successful.

However, now I need to accomodate that module into a windows application (I'm using C#). This is what I've done:

<br />
string uri = "http://111.111.111.111/app";<br />
<br />
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);<br />
request.Method = "POST";<br />
request.UserAgent = "HTTP CP Client";<br />
request.ContentType = "application/x-www-form-urlencoded";<br />
					<br />
StreamWriter writer = new StreamWriter(request.GetRequestStream());<br />
writer.WriteLine(HttpUtility.UrlEncode(strXML));<br />
writer.Close();<br />
<br />
using(HttpWebResponse response = (HttpWebResponse)request.GetResponse())<br />
{<br />
	using(StreamReader reader = new StreamReader(response.GetResponseStream()))<br />
	{<br />
		string ack = reader.ReadToEnd();<br />
		ok = true;				<br />
	}<br />
}<br />


And now I keep getting Internal Server Error.
Has anyone have experienced this before? Why does the HTML form is successful while the windows application generates error?

Thanks & Regards,

Adrian
AnswerRe: Windows Application to do HTTP Post Pin
N a v a n e e t h3-Aug-09 18:45
N a v a n e e t h3-Aug-09 18:45 
GeneralRe: Windows Application to do HTTP Post Pin
excellence803-Aug-09 19:22
excellence803-Aug-09 19:22 
GeneralRe: Windows Application to do HTTP Post Pin
excellence803-Aug-09 19:28
excellence803-Aug-09 19:28 
QuestionHow can I use System.IO to do these 3 things [modified] Pin
Nathan Revka3-Aug-09 16:27
Nathan Revka3-Aug-09 16:27 
AnswerRe: How can I use System.IO can I use to do these 3 things Pin
Christian Graus3-Aug-09 16:29
protectorChristian Graus3-Aug-09 16:29 
GeneralRe: How can I use System.IO can I use to do these 3 things Pin
Tom Deketelaere3-Aug-09 22:35
professionalTom Deketelaere3-Aug-09 22:35 
AnswerRe: How can I use System.IO to do these 3 things Pin
Xmen Real 3-Aug-09 16:49
professional Xmen Real 3-Aug-09 16:49 
AnswerRe: How can I use System.IO to do these 3 things Pin
dan!sh 3-Aug-09 17:48
professional dan!sh 3-Aug-09 17:48 
QuestionShake Logic. Pin
Baeltazor3-Aug-09 15:44
Baeltazor3-Aug-09 15:44 
AnswerRe: Shake Logic. Pin
Christian Graus3-Aug-09 16:30
protectorChristian Graus3-Aug-09 16:30 
GeneralRe: Shake Logic. Pin
Baeltazor3-Aug-09 17:13
Baeltazor3-Aug-09 17:13 
AnswerRe: Shake Logic. Pin
codemunkeh3-Aug-09 17:47
codemunkeh3-Aug-09 17:47 
GeneralRe: Shake Logic. Pin
Baeltazor3-Aug-09 17:51
Baeltazor3-Aug-09 17:51 
GeneralRe: Shake Logic. Pin
codemunkeh3-Aug-09 18:11
codemunkeh3-Aug-09 18:11 
GeneralRe: Shake Logic. Pin
Baeltazor3-Aug-09 18:15
Baeltazor3-Aug-09 18:15 
AnswerRe: Shake Logic. Pin
codemunkeh3-Aug-09 18:22
codemunkeh3-Aug-09 18:22 
GeneralRe: Shake Logic. Pin
Baeltazor3-Aug-09 18:53
Baeltazor3-Aug-09 18:53 

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.