Click here to Skip to main content
15,895,557 members
Home / Discussions / C#
   

C#

 
QuestionHow to lunch htm through C# code Pin
Alex Getman26-Apr-04 21:40
Alex Getman26-Apr-04 21:40 
AnswerRe: How to lunch htm through C# code Pin
Kannan Kalyanaraman26-Apr-04 22:50
Kannan Kalyanaraman26-Apr-04 22:50 
AnswerRe: How to lunch htm through C# code Pin
Mike Dimmick26-Apr-04 23:34
Mike Dimmick26-Apr-04 23:34 
GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 0:47
Alex Getman27-Apr-04 0:47 
GeneralRe: How to lunch htm through C# code Pin
Heath Stewart27-Apr-04 4:11
protectorHeath Stewart27-Apr-04 4:11 
GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 4:23
Alex Getman27-Apr-04 4:23 
GeneralRe: How to lunch htm through C# code Pin
Heath Stewart27-Apr-04 5:30
protectorHeath Stewart27-Apr-04 5:30 
GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 6:25
Alex Getman27-Apr-04 6:25 
still not works..;( I use following code


string page = "http://www.umc.ua/misc/sendsms.php";

WebRequest myHttpWebRequest = WebRequest.Create(page);


string postData="network1=UMC&Phone1=5918658&Message=HellofromCSharp&sender_name=sn";
ASCIIEncoding encoding=new ASCIIEncoding();
byte[] byte1=encoding.GetBytes(postData);
// Set the content type of the data being posted.
myHttpWebRequest.ContentType="application/x-www-form-urlencoded";
// Set the content length of the string being posted.
myHttpWebRequest.ContentLength=postData.Length;
Stream newStream=myHttpWebRequest.GetRequestStream();

newStream.Write(byte1,0,byte1.Length);

RES_text.Text = "The value of 'ContentLength' property after sending the data is {0}" + myHttpWebRequest.ContentLength.ToString();
// Close the Stream object.
newStream.Close();


And when I launch my app;ication and click button send, following exception occurs
************** Exception Text **************
System.Net.ProtocolViolationException: Cannot send a content-body with this verb-type.



www.xedom.com

GeneralRe: How to lunch htm through C# code Pin
Alex Getman27-Apr-04 6:38
Alex Getman27-Apr-04 6:38 
GeneralRe: Formula Pin
Jeff Varszegi26-Apr-04 19:43
professionalJeff Varszegi26-Apr-04 19:43 
GeneralRe: Formula Pin
DucLinh26-Apr-04 20:59
DucLinh26-Apr-04 20:59 
GeneralRe: Formula Pin
Jeff Varszegi27-Apr-04 3:09
professionalJeff Varszegi27-Apr-04 3:09 
GeneralRe: Formula Pin
Mazdak26-Apr-04 21:12
Mazdak26-Apr-04 21:12 
GeneralRe: Formula Pin
leppie27-Apr-04 7:05
leppie27-Apr-04 7:05 
GeneralParsing a string object Pin
Tony D. Abel26-Apr-04 17:55
Tony D. Abel26-Apr-04 17:55 
GeneralRe: Parsing a string object Pin
Jeff Varszegi26-Apr-04 18:05
professionalJeff Varszegi26-Apr-04 18:05 
GeneralRe: Parsing a string object Pin
Tony D. Abel27-Apr-04 7:02
Tony D. Abel27-Apr-04 7:02 
GeneralFormula Pin
DucLinh26-Apr-04 15:56
DucLinh26-Apr-04 15:56 
Generalcreating an array of existing WinForm controls Pin
Roman Nurik26-Apr-04 13:48
Roman Nurik26-Apr-04 13:48 
GeneralRe: creating an array of existing WinForm controls Pin
Roman Nurik26-Apr-04 13:51
Roman Nurik26-Apr-04 13:51 
GeneralRe: creating an array of existing WinForm controls Pin
Mike Dimmick26-Apr-04 23:43
Mike Dimmick26-Apr-04 23:43 
GeneralRe: creating an array of existing WinForm controls Pin
Mike Ellison26-Apr-04 17:03
Mike Ellison26-Apr-04 17:03 
GeneralRe: creating an array of existing WinForm controls Pin
Heath Stewart27-Apr-04 4:17
protectorHeath Stewart27-Apr-04 4:17 
GeneralLabel question... Pin
spoon vs fork26-Apr-04 13:47
spoon vs fork26-Apr-04 13:47 
GeneralRe: Label question... Pin
Roman Rodov26-Apr-04 14:55
Roman Rodov26-Apr-04 14:55 

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.