Click here to Skip to main content
15,908,901 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to disable hardware devices in computer Pin
Niiiissssshhhhhuuuuu25-Sep-06 21:46
Niiiissssshhhhhuuuuu25-Sep-06 21:46 
GeneralRe: How to disable hardware devices in computer Pin
delimavi25-Sep-06 22:39
delimavi25-Sep-06 22:39 
AnswerRe: How to disable hardware devices in computer Pin
Niiiissssshhhhhuuuuu25-Sep-06 23:39
Niiiissssshhhhhuuuuu25-Sep-06 23:39 
AnswerRe: How to disable hardware devices in computer Pin
Niiiissssshhhhhuuuuu25-Sep-06 23:40
Niiiissssshhhhhuuuuu25-Sep-06 23:40 
QuestionRetrieve windows users list Pin
Alper Camel25-Sep-06 21:04
Alper Camel25-Sep-06 21:04 
AnswerRe: Retrieve windows users list Pin
Niiiissssshhhhhuuuuu25-Sep-06 21:35
Niiiissssshhhhhuuuuu25-Sep-06 21:35 
GeneralRe: Retrieve windows users list Pin
Alper Camel25-Sep-06 21:42
Alper Camel25-Sep-06 21:42 
QuestionException occured in deserialization of memory stream(Its Urgent) Pin
Khushi8325-Sep-06 21:02
Khushi8325-Sep-06 21:02 
I developed a chat application.When i send a lengthy text or an emoticons then it shows an exception

An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll

Additional information: End of Stream encountered before parsing was completed.

below is my code of recieving data
------------------------------------------------------------------------------
public void XOnMessageRecieving(IAsyncResult ar)
{
try
{
ClsPacket stObj = (ClsPacket) ar.AsyncState; // restore state object..
if (stObj == null)
{
return; // if any of the remote end has been disposed then... finish futher processing..
}
int bytesRecieved = stObj.Soket.EndReceive(ar); // end the asynchronous call and get number of bytes recieved..
if (bytesRecieved < stObj.Bufer.Length) // if number of bytes recieverd are less than the buffer length ... i.e. 32
{
stObj.ContextBuffer.Write(stObj.Bufer,0,bytesRecieved);//put last bytes recieved...
stObj.ContextBuffer.Seek(0,0); //put reference to the begining of memory stream..
stObj.ContextBuffer.Position=0;



BinaryFormatter bFormatter = new BinaryFormatter(); //set up a formatter to deserialize object form memory stream...
try
{
EvtArgCCI cciArg = (EvtArgCCI) bFormatter.Deserialize(stObj.ContextBuffer); // decerialize object and get it as EvtArgCCI object..
ClsCCI.XFireCCIMessageEvent(cciArg); // send this information to other managers through CCI to take proper actions..
}
catch(Exception ex)
{
//here comes the exception "End of stream encountered before parsing was compeleted."
}
stObj.ContextBuffer = new MemoryStream(); // clear the memory stream.. for other message...
}
else
{

stObj.ContextBuffer.Write(stObj.Bufer,0,bytesRecieved); // keep storing the message into state object untill whole message/packet is read...
}
try
{
stObj.Soket.BeginReceive(stObj.Bufer,0,stObj.Bufer.Length,SocketFlags.None,new AsyncCallback(XOnMessageRecieving),stObj); // create an asynchrounous hook to continue recieving packets....
}
catch(Exception ex)
{

}
}
catch(Exception ex)
{
}
}

Adeel

Questionhelp me plz Pin
sunita ramesh25-Sep-06 20:51
sunita ramesh25-Sep-06 20:51 
AnswerRe: help me plz Pin
Niiiissssshhhhhuuuuu25-Sep-06 21:43
Niiiissssshhhhhuuuuu25-Sep-06 21:43 
Answersee the below link it will helpful to you Pin
premkamalg25-Sep-06 22:22
premkamalg25-Sep-06 22:22 
Questionclosing already opened forms Pin
saqib8225-Sep-06 19:51
saqib8225-Sep-06 19:51 
AnswerRe: closing already opened forms Pin
rah_sin25-Sep-06 20:52
professionalrah_sin25-Sep-06 20:52 
GeneralRe: closing already opened forms Pin
saqib8225-Sep-06 22:02
saqib8225-Sep-06 22:02 
AnswerRe: closing already opened forms Pin
Niiiissssshhhhhuuuuu25-Sep-06 21:29
Niiiissssshhhhhuuuuu25-Sep-06 21:29 
QuestionOffice automation Pin
IamADotNetGuy25-Sep-06 18:30
IamADotNetGuy25-Sep-06 18:30 
AnswerRe: Office automation Pin
WillemM25-Sep-06 21:26
WillemM25-Sep-06 21:26 
Questiondynamically changing assembly Pin
For_IT25-Sep-06 18:20
For_IT25-Sep-06 18:20 
AnswerRe: dynamically changing assembly Pin
Rob Philpott26-Sep-06 0:33
Rob Philpott26-Sep-06 0:33 
Questiongetting a count of a delimiter in a string Pin
Keshav V. Kamat25-Sep-06 17:27
Keshav V. Kamat25-Sep-06 17:27 
AnswerRe: getting a count of a delimiter in a string Pin
Niiiissssshhhhhuuuuu25-Sep-06 17:48
Niiiissssshhhhhuuuuu25-Sep-06 17:48 
GeneralRe: getting a count of a delimiter in a string Pin
Keshav V. Kamat25-Sep-06 18:21
Keshav V. Kamat25-Sep-06 18:21 
AnswerRe: getting a count of a delimiter in a string Pin
Guffa25-Sep-06 18:41
Guffa25-Sep-06 18:41 
JokeRe: getting a count of a delimiter in a string Pin
lmoelleb25-Sep-06 21:10
lmoelleb25-Sep-06 21:10 
GeneralRe: getting a count of a delimiter in a string Pin
LongRange.Shooter26-Sep-06 8:00
LongRange.Shooter26-Sep-06 8:00 

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.