public class WorkFlow{
public WorkFlow(Socket socket){
_socket = socket;
dataMDL = new Datamdl();
}
public void ThreadProc(){
int records, offset;
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
Byte[] ReceiveBuffer = new Byte[256];
Byte[] SendBuffer = new Byte[1000];
DataTable dataTable;
NetworkStream networkStream = new NetworkStream(_socket);
networkStream.Read(ReceiveBuffer, 0, 256);
string receive = new string(encoding.GetChars(ReceiveBuffer));
Console.WriteLine("Received from client of inquire: [" + receive + "]");
string OperationType = receive.Substring(0, 3);
-----------------------------------
networkStream.Write(SendBuffer, 0, 1000);
//networkStream.Flush();
networkStream.Close();
_socket.Close();
//System.Threading.Thread.CurrentThread.Abort();
Console.WriteLine("Now End a conversation.****");
return;
}
private void String2ByteArray(ref Byte[] ArrayByte, int start, string convert, int length){
int len = ArrayByte.Length;
if(start+length>len) return;
if(convert.Length<length) length=convert.Length;
Console.WriteLine("=Start to Convert=" + convert);
Byte[] tmpByteArray = System.Text.Encoding.Default.GetBytes(convert);
tmpByteArray.CopyTo(ArrayByte, start);
//Console.WriteLine("=End to Convert="+ System.Text.ASCIIEncoding.ASCII.GetChars(tmpByteArray));
}