Click here to Skip to main content
15,922,512 members
Home / Discussions / C#
   

C#

 
GeneralFind Selected row in Datagrid Pin
joy_priyank14-Mar-05 17:35
joy_priyank14-Mar-05 17:35 
GeneralRe: Find Selected row in Datagrid Pin
NickyWang14-Mar-05 21:03
NickyWang14-Mar-05 21:03 
GeneralRe: Find Selected row in Datagrid Pin
joy_priyank15-Mar-05 0:03
joy_priyank15-Mar-05 0:03 
GeneralRe: Find Selected row in Datagrid Pin
Robert Rohde14-Mar-05 23:10
Robert Rohde14-Mar-05 23:10 
GeneralRe: Find Selected row in Datagrid Pin
joy_priyank14-Mar-05 23:54
joy_priyank14-Mar-05 23:54 
GeneralRe: Find Selected row in Datagrid Pin
Robert Rohde15-Mar-05 6:14
Robert Rohde15-Mar-05 6:14 
GeneralRe: Find Selected row in Datagrid Pin
DriesDeRudder16-Mar-05 4:10
DriesDeRudder16-Mar-05 4:10 
GeneralC# binary image to web PHP Pin
poomunch314-Mar-05 14:28
poomunch314-Mar-05 14:28 
Hi,

I'm trying to send an image from a C# WinForm app to a PHP page in binary format.

All PHP is taken care of, and security is of no concern.

My problem is that I'm not sure how the correct way to post the info is..

So far, I've got:

///////////Code Starts...
string myUrl=/*myURLhere*/;
string result ="";

FileStream fs = new FileStream(@"c:\image.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Byte[] buffer = br.ReadBytes((int)fs.Length);

HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(myUrl);
wr.Method= "POST";
wr.ContentType = "application/x-www-form-urlencoded";
wr.ContentLength = buffer.Length + 8; //For the variable header "myImage=" in POST

StreamWriter sw = new StreamWriter(wr.GetRequestStream());
sw.Write("myImage=" + buffer);
sw.Close();

HttpWebResponse webResponse = (HttpWebResponse)wr.GetResponse();
Stream s = webResponse.GetResponseStream();

StreamReader sr = new StreamReader(s);
result = sr.ReadToEnd();

/////////////End Code

The debugger stops at the line

HttpWebResponse webResponse = (HttpWebResponse)wr.GetResponse();

With error:
Additional information: The request was aborted: The request was canceled.

Any suggestions?

Many thanks to anyone who can help out.

Timbo
GeneralStreams and Files Pin
felopater14-Mar-05 14:19
felopater14-Mar-05 14:19 
GeneralBeginner's Class -> Memory Questions Pin
GhostsOfOrion14-Mar-05 13:10
GhostsOfOrion14-Mar-05 13:10 
GeneralRe: Beginner's Class -> Memory Questions Pin
S. Senthil Kumar14-Mar-05 17:59
S. Senthil Kumar14-Mar-05 17:59 
GeneralRe: Beginner's Class -> Memory Questions Pin
GhostsOfOrion14-Mar-05 18:31
GhostsOfOrion14-Mar-05 18:31 
GeneralOpening and reading access Database using csharp Pin
gijoebijoe14-Mar-05 8:39
gijoebijoe14-Mar-05 8:39 
GeneralRe: Opening and reading access Database using csharp Pin
Judah Gabriel Himango14-Mar-05 8:52
sponsorJudah Gabriel Himango14-Mar-05 8:52 
GeneralRe: Opening and reading access Database using csharp Pin
Ravindra Sadaphule14-Mar-05 12:48
Ravindra Sadaphule14-Mar-05 12:48 
GeneralBug in CSC.Exe Pin
raysot77714-Mar-05 8:38
raysot77714-Mar-05 8:38 
GeneralRe: Bug in CSC.Exe Pin
Ravindra Sadaphule14-Mar-05 12:57
Ravindra Sadaphule14-Mar-05 12:57 
GeneralRe: Bug in CSC.Exe Pin
Anonymous14-Mar-05 15:19
Anonymous14-Mar-05 15:19 
Generallistview with transparent background Pin
grandad8014-Mar-05 8:21
sussgrandad8014-Mar-05 8:21 
QuestionConfiguration Files? Pin
spacebass500014-Mar-05 7:39
spacebass500014-Mar-05 7:39 
AnswerRe: Configuration Files? Pin
Anonymous14-Mar-05 8:58
Anonymous14-Mar-05 8:58 
GeneralThread Pin
Blue_Skye14-Mar-05 6:56
Blue_Skye14-Mar-05 6:56 
GeneralRe: Thread Pin
Judah Gabriel Himango14-Mar-05 7:26
sponsorJudah Gabriel Himango14-Mar-05 7:26 
GeneralC# pixel color grouping Pin
Rene Xavier14-Mar-05 6:56
Rene Xavier14-Mar-05 6:56 
GeneralRe: C# pixel color grouping Pin
Robert Rohde14-Mar-05 18:42
Robert Rohde14-Mar-05 18:42 

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.