protected override bool AssemblyMessage() { if (!base.AssemblyMessage()) { return(false); } string filePath = @"../../test.txt"; FileThread file = new FileThread(); string str = file.GetFileString(filePath); m_BackMessage = "File "; m_BackMessage += "test.txt "; m_BackMessage += str; return(true); }
public static void Main(string[] args) { byte[] data = new byte[2048]; Socket tcpServer = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); tcpServer.Bind(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 6789)); tcpServer.Listen(100); ServerThread server = new ServerThread(tcpServer); server.Start(); string filePath = @"../../test.txt"; FileThread file = new FileThread(); string str = file.GetFileString(filePath); Console.WriteLine(str); }