(adsbygoogle = window.adsbygoogle || []).push({});
Source Download Link -
You must login or register to view this content.
Quite a messy and poorly done program, but it was just a simple quick fast program i made to add some colour to the forums.
If you don't care about the source you can run the exe in BBC_CodeFormat/bin/Debug/BBC_CodeFormat.exe
If you want to add more to the "word list" for the colour blue, add the words to the following array (in the source).
string[] Blues =
new string[]
{
"using",
"namespace",
"public",
"private",
"partial",
"class",
"this",
"new",
"string",
"uint",
"int",
"float",
"decimal",
"byte",
"object",
"for",
"void",
"enum",
"null"
};
You must login or register to view this content.
Example Output;
//********************* Client Code ***********************
//Here I am giving the Sample client code.
//Which I feel doesn't need any explanation.
class TCPClient
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static
void Main(
string[] args)
{
TCPClient client = null;
client = new TCPClient("SatyaTest.txt
");
client = new TCPClient("SatyaTest1.txt
");
client = new TCPClient("SatyaTest2.txt
");
client = new TCPClient("SatyaTest3.txt
");
client = new TCPClient("SatyaTest4.txt
");
client = new TCPClient("SatyaTest5.txt
");
}
private String m_fileName=
null;
public TCPClient(String fileName)
{
m_fileName=fileName;
Thread t = new Thread(new ThreadStart(ClientThreadStart));
t.Start();
}
private void ClientThreadStart()
{
Socket clientSocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp );
clientSocket.Connect(new IPEndPoint(IPAddress.Parse("127.0.0.1"),31001));
// Send the file name.
clientSocket.Send(Encoding.ASCII.GetBytes(m_fileName));
// Receive the length of the filename.
byte [] data = new byte[128];
clientSocket.Receive(data);
int length=BitConverter.ToInt32(data,0);
clientSocket.Send(Encoding.ASCII.GetBytes(m_fileName+":"+
"this is a test
"));
clientSocket.Send(Encoding.ASCII.GetBytes(m_fileName+":"+
"THIS IS "));
clientSocket.Send(Encoding.ASCII.GetBytes("ANOTHRER "));
clientSocket.Send(Encoding.ASCII.GetBytes("TEST."));
clientSocket.Send(Encoding.ASCII.GetBytes("
"));
clientSocket.Send(Encoding.ASCII.GetBytes(m_fileName+":"+
"TEST.
"+m_fileName+":"+"TEST AGAIN.
"));
clientSocket.Send(Encoding.ASCII.GetBytes("[EOF]
"));
// Get the total length
clientSocket.Receive(data);
length=BitConverter.ToInt32(data,0);
clientSocket.Close();
}
}