الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف استطيع ان ااتى بال IP ADDRESS FOR

مغلق
بدأه belal.net في 7 سبتمبر 2004 · 4 رد · 620 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

كيف استطيع ان اجيب ال 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

#2

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

رأس الحكمة الإيمان بالله

#3

يا اخ محمد انا الى الان لم اتعلم 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

#4

هذا هو الكود بال 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

opensource-550x4752.gif

#5

شكرا لك اخى راكن ولكن هذا الكود بالفيجوال بيسك على العموم هذا الجزء هل ممكن يفهمه السى شارب؟

اقتباس
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

هذا الموضوع مغلق.

مواضيع مشابهة