1
我想創建一個TcpClient的,並與構造有問題......TcpClient的構造問題C#
public class TcpClient : IDisposable
{
static void Connect(String server, String message)
{
try
{
// Create a TcpClient.
// Note, for this client to work you need to have a TcpServer
// connected to the same address as specified by the server, port
// combination.
Int32 port = 9000;
TcpClient client = new TcpClient(server, port);
我得到錯誤:
Error 1 'TcpClient' does not contain a constructor that takes 2 arguments
我的問題:
爲什麼會出現這個問題&如何解決它?
你爲什麼要創建一個TcpClient的時候就已經有內置的框架這樣的班:http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx –