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

C#

 
QuestionSaving changes to a dataGridView - colour rows Pin
steve_rm27-Mar-07 11:36
steve_rm27-Mar-07 11:36 
AnswerRe: Saving changes to a dataGridView - colour rows Pin
joon vh.28-Mar-07 4:08
joon vh.28-Mar-07 4:08 
QuestionIs is possible to Serialise a Dynamically created assembly? Pin
Trevor T27-Mar-07 11:07
Trevor T27-Mar-07 11:07 
Questionread image from picture box Pin
iman_kh27-Mar-07 10:53
iman_kh27-Mar-07 10:53 
AnswerRe: read image from picture box Pin
art_coding27-Mar-07 11:37
art_coding27-Mar-07 11:37 
QuestionAcceptchange() in data set Pin
iman_kh27-Mar-07 10:51
iman_kh27-Mar-07 10:51 
QuestionProvider model Pin
netJP12L27-Mar-07 10:24
netJP12L27-Mar-07 10:24 
QuestionC# network transfer stream problem Pin
art_coding27-Mar-07 10:19
art_coding27-Mar-07 10:19 
I am building a chat with file transfer support. I use normally the StreamReader and the StreamWriter built over the NetworkStream, but when i want to send data from a file i would like to use NetworkStream directly, to write bytes without encoding/decoding. If i don't use direcly the NetworkStream (convert all my byte[] to char[], then sending, and converting back after receive) things goes fine.
...
NetworkStream networkStream = socketForServer.GetStream();
StreamReader netStreamreader = new StreamReader(networkStream);
StreamWriter netStreamwriter = new StreamWriter(networkStream);
...

//The writer program:
byte[] buf = ...
netStreamwriter.WriteLine(someString);
netStreamwriter.WriteLine(buf.Length);
netStreamwriter.Flush();
networkStream.Write(buf, 0, buf.Length);
networkStream.Flush();
...

//The reader program:
myString = netStreamreader.ReadLine();
size = Convert.ToInt32(netStreamreader.ReadLine());
byte[] buf = new byte[size];
networkStream.Read(buf, 0, size);
...

This does not work, oh it does for the first times (randomly each run) and then unexpected happens, it cuts parts and reader program reads thrashes because of desincronization with the sending program. Is there another way of sending/receiving raw data ? What am i missing...
QuestionClass "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Edmundisme27-Mar-07 9:54
Edmundisme27-Mar-07 9:54 
AnswerRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Dave Kreskowiak27-Mar-07 10:11
mveDave Kreskowiak27-Mar-07 10:11 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Austin Harris27-Mar-07 10:25
Austin Harris27-Mar-07 10:25 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Dave Kreskowiak27-Mar-07 12:43
mveDave Kreskowiak27-Mar-07 12:43 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Leslie Sanford27-Mar-07 10:26
Leslie Sanford27-Mar-07 10:26 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Edmundisme27-Mar-07 10:27
Edmundisme27-Mar-07 10:27 
AnswerRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Leslie Sanford27-Mar-07 10:22
Leslie Sanford27-Mar-07 10:22 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Edmundisme27-Mar-07 10:36
Edmundisme27-Mar-07 10:36 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Leslie Sanford27-Mar-07 10:47
Leslie Sanford27-Mar-07 10:47 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Edmundisme27-Mar-07 11:49
Edmundisme27-Mar-07 11:49 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
led mike28-Mar-07 5:21
led mike28-Mar-07 5:21 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Edmundisme28-Mar-07 6:15
Edmundisme28-Mar-07 6:15 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Edmundisme28-Mar-07 6:30
Edmundisme28-Mar-07 6:30 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
led mike28-Mar-07 6:52
led mike28-Mar-07 6:52 
GeneralRe: Class "Child" MUST NOT call "Euthanize" on class "Dog" Pin
Edmundisme28-Mar-07 7:21
Edmundisme28-Mar-07 7:21 
QuestionAppDomains & Loading Assemblies Pin
AJ12327-Mar-07 9:19
AJ12327-Mar-07 9:19 
AnswerRe: AppDomains & Loading Assemblies Pin
S. Senthil Kumar27-Mar-07 17:01
S. Senthil Kumar27-Mar-07 17:01 

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.