Click here to Skip to main content
16,013,207 members
Home / Discussions / C#
   

C#

 
GeneralRe: STM_SETIMAGE Pin
vikramlinux11-Jun-02 20:08
vikramlinux11-Jun-02 20:08 
GeneralWM_COMMAND Pin
vikramlinux11-Jun-02 4:22
vikramlinux11-Jun-02 4:22 
GeneralRe: WM_COMMAND Pin
Rickard Andersson2011-Jun-02 8:46
Rickard Andersson2011-Jun-02 8:46 
GeneralIMessageFilter.PreFilterMessage Pin
Wizard_0110-Jun-02 23:32
Wizard_0110-Jun-02 23:32 
GeneralRe: IMessageFilter.PreFilterMessage Pin
Rama Krishna Vavilala11-Jun-02 3:20
Rama Krishna Vavilala11-Jun-02 3:20 
GeneralRe: IMessageFilter.PreFilterMessage Pin
Wizard_0111-Jun-02 3:38
Wizard_0111-Jun-02 3:38 
GeneralRe: IMessageFilter.PreFilterMessage Pin
James T. Johnson11-Jun-02 9:21
James T. Johnson11-Jun-02 9:21 
QuestionClearing byte[ ] ? Pin
10-Jun-02 11:40
suss10-Jun-02 11:40 
I declare a byte array:

byte[] byteIn = new byte[1024];

I write to it like so:
//set newin to false, info is old
     				newin = false;
     				Console.WriteLine("Waiting to recieve new data from client");
     				//clear byteIn
     				
     		
     				
     				while(!newin)
     				{
      					mySocket.Receive(byteIn, 0, mySocket.Available, SocketFlags.None);
      			
						strIn = Encoding.ASCII.GetString(byteIn);
						
						if(strIn != strInbuff)
						{
							newin = true;
						}
						
						strInbuff = strIn;
						
						Console.WriteLine(strIn);
					}


The problem is, next time I loop to this nested while statment if I write a smaller value to my byte[ ] it leaves some info unwritten... I need a way of clearing it. Is there some function for this that I can't find on msdn?

Also, If anyone has a better way of detecting new input from a socket let me know... for now I use this resource consuming while loop.. it requires a string for input and a string to see if that input is new (in which case the loop is broken).

Another quick question. I want to declare a class public, like so:

cserver CServer = new cserver();

is how i delcare it, but this object is not accessable to other functions/objects... i cant do public cserver CServer = new cserver(); , I already tried Smile | :)

Thanks.
AnswerRe: Clearing byte[ ] ? Pin
Rüpel10-Jun-02 20:04
Rüpel10-Jun-02 20:04 
GeneralRe: Clearing byte[ ] ? Pin
11-Jun-02 9:34
suss11-Jun-02 9:34 
QuestionWindows Time Inactive? Pin
10-Jun-02 5:42
suss10-Jun-02 5:42 
AnswerRe: Windows Time Inactive? Pin
Rüpel10-Jun-02 19:48
Rüpel10-Jun-02 19:48 
GeneralAnakrino Pin
Rüpel10-Jun-02 2:30
Rüpel10-Jun-02 2:30 
GeneralRe: Anakrino Pin
Rocky Moore10-Jun-02 18:51
Rocky Moore10-Jun-02 18:51 
GeneralRe: Anakrino Pin
Rüpel10-Jun-02 19:46
Rüpel10-Jun-02 19:46 
GeneralWebBrowser in .NET Applications Pin
10-Jun-02 1:32
suss10-Jun-02 1:32 
GeneralRe: WebBrowser in .NET Applications Pin
AndyG10-Jun-02 4:01
AndyG10-Jun-02 4:01 
GeneralRe: WebBrowser in .NET Applications Pin
Richard Deeming11-Jun-02 4:25
mveRichard Deeming11-Jun-02 4:25 
GeneralDisplaying sub Properties in PropertyGrid Pin
leppie10-Jun-02 0:51
leppie10-Jun-02 0:51 
GeneralRe: Displaying sub Properties in PropertyGrid Pin
Mazdak10-Jun-02 1:06
Mazdak10-Jun-02 1:06 
GeneralRe: Displaying sub Properties in PropertyGrid Pin
leppie10-Jun-02 1:14
leppie10-Jun-02 1:14 
GeneralRe: Displaying sub Properties in PropertyGrid Pin
Rama Krishna Vavilala10-Jun-02 1:48
Rama Krishna Vavilala10-Jun-02 1:48 
GeneralRe: Displaying sub Properties in PropertyGrid Pin
leppie10-Jun-02 1:48
leppie10-Jun-02 1:48 
GeneralRe: Displaying sub Properties in PropertyGrid Pin
James T. Johnson10-Jun-02 2:21
James T. Johnson10-Jun-02 2:21 
GeneralRe: Displaying sub Properties in PropertyGrid Pin
leppie10-Jun-02 3:43
leppie10-Jun-02 3:43 

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.