R
Richard
im fairly new to c# but im trying to display some text in a textbox and i
get the error
"Cant access nonstatic member from outer type "Server.Form1" via nested type
"Server.Form1.SocketPacket"
code: -
public class SocketPacket
{
public Socket thisSocket = null;
public byte[] byteBuffer = new byte[256];
public int id = 0;
private StringBuilder stringBuffer = new StringBuilder();
public void appendStringBuffer(string data)
{
this.stringBuffer.Append(data);
string text = this.stringBuffer.ToString();
int end = text.Length;
if(text.LastIndexOf('?') == text.Length)
{
addTextToConsole(text);
}
}
}
here's the function im trying to call :-
public void addTextToConsole(string text)
{
ConsoleTextBox.Text += text;
ConsoleTextBox.Text += "\r\n";
ConsoleTextBox.Select(ConsoleTextBox.Text.Length, 0);
ConsoleTextBox.ScrollToCaret();
}
thanks for anyhelp!
R.Adnams
get the error
"Cant access nonstatic member from outer type "Server.Form1" via nested type
"Server.Form1.SocketPacket"
code: -
public class SocketPacket
{
public Socket thisSocket = null;
public byte[] byteBuffer = new byte[256];
public int id = 0;
private StringBuilder stringBuffer = new StringBuilder();
public void appendStringBuffer(string data)
{
this.stringBuffer.Append(data);
string text = this.stringBuffer.ToString();
int end = text.Length;
if(text.LastIndexOf('?') == text.Length)
{
addTextToConsole(text);
}
}
}
here's the function im trying to call :-
public void addTextToConsole(string text)
{
ConsoleTextBox.Text += text;
ConsoleTextBox.Text += "\r\n";
ConsoleTextBox.Select(ConsoleTextBox.Text.Length, 0);
ConsoleTextBox.ScrollToCaret();
}
thanks for anyhelp!
R.Adnams