PDA

View Full Version : جرا این خط رو نمیشناسه؟



mostafa_shoakry
جمعه 09 مهر 1389, 17:18 عصر
سلام من اولین پروژه سوکت خودمو عینا از رو کتاب نوشتم ولی خطا می ده اون خطی که قرمز کردم و نمیشناسه :گریه:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private String PrintHello(String host)
{
String msg = "";
try
{
IPHostEntry hostInfo;
این خط//hostInfo = Dns.EndGetHostEntry();
msg = "\tConditional Name: " + hostInfo.HostName + "\r";
msg += "\tIP Addresses: ";
foreach (IPAddress ipadd in hostInfo.AddressList)
{
msg += ipadd.ToString() + " ";

}
msg += "\r";
msg += "\t Aliases: ";
foreach (String alias in hostInfo.Aliases)
{
msg += alias + " ";
}
msg += "\r";

}
catch (Exception)
{
msg += "\tUnable to resolve host: " + host + "\n";

}
return msg;
}
private void button1_Click(object sender, EventArgs e)
{
String msg2, s;
msg2 = "";
msg2 = "Local Host:\r";
این خط//String localHostName = Dns.EndGetHostEntry();

}
}
}