void show(Queue recv, stringclass stri) { string recvstr = String.Empty; while (true) { Thread.Sleep(200); if (recv.Count >= 1) { recvstr = recv.Dequeue() as string; int forn; for (forn = 0; forn <= (stri.set(@"@#").Length + 11); forn++) { Console.Write('\u0008'); } for (forn = 0; forn <= (stri.set(@"@#").Length + 11); forn++) { Console.Write(" "); } for (forn = 0; forn <= (stri.set(@"@#").Length + 11); forn++) { Console.Write('\u0008'); } // Console.WriteLine(""); Console.WriteLine("Recv => " + recvstr); Console.Write("Edit => " + stri.set(@"@#")); } } }
//------------------------------------------------老的文件引擎<\> //------------------------------------------------new File engine void input(Queue send, stringclass str) { Console.Write("Edit => "); while (true) { char inputchar = Console.ReadKey().KeyChar; if (inputchar != '\r') { str.set(str.set(@"@#") + inputchar); } if (inputchar == '\r') { send.Enqueue((object)str.set(@"@#")); Console.WriteLine("Sent => " + inputstr); str.set(String.Empty); Console.Write("Edit => "); } } }
void show(stringclass str, System.Net.Sockets.Socket socket, statesaver stdsav) { string recvstr = String.Empty; while (true) { Thread.Sleep(200); if (recvmsg.Count >= 1) { recvstr = recvmsg.Dequeue() as string; int forn; for (forn = 0; forn <= (str.set(@"@#").Length + 11); forn++) { Console.Write('\u0008'); } for (forn = 0; forn <= (str.set(@"@#").Length + 11); forn++) { Console.Write(" "); } for (forn = 0; forn <= (str.set(@"@#").Length + 11); forn++) { Console.Write('\u0008'); } // Console.WriteLine(""); if (recvstr == @"$%$filereq") { stdsav.set(0); Console.WriteLine("Recv => " + "FILE"); filerecvlaunch(socket); // Console.WriteLine("-------------------------------------------------set state to 1"); stdsav.set(1); } if (recvstr != @"$%$filereq") { Console.WriteLine("Recv => " + recvstr); } Console.Write("Edit => " + str.set(@"@#")); } } }
void input(stringclass str, System.Net.Sockets.Socket socket, statesaver stdsav) { Console.Write("Edit => "); while (true) { char inputchar = Console.ReadKey().KeyChar; if (inputchar != '\r') { str.set(str.set(@"@#") + inputchar); } if (inputchar == '\r') { // if(inputstr!=String.Empty) // { if (str.set(@"@#") == filesendkeyword) { stdsav.set(0); Console.WriteLine("Sent => " + "FILE"); filesendlaunch(socket); // Console.WriteLine("-------------------------------------------------set state to 1"); stdsav.set(1); } if (str.set(@"@#") != filesendkeyword) { Console.WriteLine("Sent => " + inputstr); } sentmsg.Enqueue((object)str.set(@"@#")); // } // if(inputstr==String.Empty) // { // Console.WriteLine("--空内容--\n"); // } str.set(String.Empty); Console.Write("Edit => "); } } }