كيف استطيع ان اجيب ال ip address لاى جهاز اقوم بتشغيل البرنامج عليه انا جربت وبحثت فى system.enviroment & system .net ولكن لم استطيع ان احصل عليها
ارجو الافده
كيف استطيع ان اجيب ال ip address لاى جهاز اقوم بتشغيل البرنامج عليه انا جربت وبحثت فى system.enviroment & system .net ولكن لم استطيع ان احصل عليها
ارجو الافده
بسم الله الرحمن الرحيم
إِنَّ الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ إِنَّا لَا نُضِيعُ أَجْرَ مَنْ أَحْسَنَ عَمَلاً
صدق الله العظيم
=================
Belal Mahmoud Younes
Solution Developer
Link Development a LINKdotNET subsidiary
Mobile : 010 89 69 772
E-mail : belalyounes@hotmail.com
I believe you'll get the defualt IP address of the current machine (127.0.0.1) if
you are not connected to a network or to the internet
اقتباسانا جربت وبحثت فى system.enviroment & system .net ولكن لم استطيع ان احصل عليها
System.Environment class gets the local machine info
System.Net should help you to get IP addresses
:Take this example
using System.Net;
IPHostEntry IPEntry;
try
{
IPEntry = Dns.Resolve(this.textBox1.Text);
foreach (IPAddress ip in IPEntry.AddressList )
{
this.textBox2.Text = ip.ToString();
}
}
catch
{
MessageBox.Show("Error while getting IP Address","Error.",
MessageBoxButtons.OK,MessageBoxIcon.Error);
}
textbox1 is the field that you write your URL or computer name in if you are
in a network, and textbox2 is the field that displays the IP address of the URL
in textbox1, put this procedures in a button_click and test it, hope that helps
رأس الحكمة الإيمان بالله
يا اخ محمد انا الى الان لم اتعلم windows application ولكن فهمت بعض الاشياء ولكن سؤالى هنا هو هل يوجد function او اى شىء من هذا القبيل تفوم بالاتيان ب ip???
system.net...............any function make this problem
وشكرا لك اخى محمد وانا اقصد كل ذلك بالconsole
ولك جزيل الشكر
بسم الله الرحمن الرحيم
إِنَّ الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ إِنَّا لَا نُضِيعُ أَجْرَ مَنْ أَحْسَنَ عَمَلاً
صدق الله العظيم
=================
Belal Mahmoud Younes
Solution Developer
Link Development a LINKdotNET subsidiary
Mobile : 010 89 69 772
E-mail : belalyounes@hotmail.com
هذا هو الكود بال console
Imports System.Net Module Module1 Sub Main() Dim ip As IPHostEntry = Dns.Resolve(Dns.GetHostName()) Console.Write(ip.AddressList(0).ToString) While True End While End Sub End Module
راكان الحنيطي
Be Open Source

شكرا لك اخى راكن ولكن هذا الكود بالفيجوال بيسك على العموم هذا الجزء هل ممكن يفهمه السى شارب؟
اقتباسConsole.Write(ip.AddressList(0).ToString)
وشكرا لكم
بسم الله الرحمن الرحيم
إِنَّ الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ إِنَّا لَا نُضِيعُ أَجْرَ مَنْ أَحْسَنَ عَمَلاً
صدق الله العظيم
=================
Belal Mahmoud Younes
Solution Developer
Link Development a LINKdotNET subsidiary
Mobile : 010 89 69 772
E-mail : belalyounes@hotmail.com
هذا الموضوع مغلق.