ارجوكي يا اخواني عايز اعرض ال arp table بالفيزكال ادريس بي كل حاجه زي الي بيطلع في النت كت ياريت حد يكتبلي الكود ضروري بليييييييييييز انا حاولت بال اي بي اي فنكشن الي في الاي بي هيلبر ومعرفتش اعرضو ارجوكو حد يكتبلي كود كامل من اول استخدام لحد تحويل الجدول لسسترينجات واكون شاكر جدا جدا
كيفبة استخراج الarp table
اخ ameer-ali
انت مخالف قواعد المشاركة
1- بعدم ذكر عنوان يدل على مايحيويه الموضوع
2 - عدم ذكر السؤال بطريقة مفهومه ...
لذا اعتقد أن الموضوع سيغلق
انا اسف يا اخ خبير بس دي اول مشاركه ليا فيالمنتدى كلو وياريت متبقاش جيا بغق يعني القواعد انا مش عارفها اما عن السؤال
فا انا بقول انا عايز اعرض جدول arp-table الي فيه الاي بي ادرس والفيزيكل ادرس زي الي بيطلع في برنامج النت كت عايز اعرف ازاي ممكن اعرضو في برنامج باستخدام فيجوال بيسك دوت نت او سي شارب
ياريت اكون وضحت
أولا الأخ HnHn معه حق وقراءة قواعد المشاركة ما بياخذ وقت والالتزام بها ما بيكلفك شئ
ثانيا أنت عم تسأل عن الـ Ip address وأعتقد أن موضوعك بالأساس بالقسم الغلط لأنو متعلق ببرمجة الشبكات
منقول للقسم الصحيح
تم تعديل هذه المشاركة بواسطة samerselo في 11 أكتوبر 2006 في 19:54
عن عائشة رضي الله عنها أن النبي صلى الله عليه وسلم قال: إن الله يحب إذا عمل أحدكم عملا أن يتقنه
نعيب زماننا والعيب فينا ... وما لزماننا عيب سوانا
ونهجو ذا الزمان بغير ذنب ... ولو نطق الزمان لنا هجانا
محمد سامر أبو سلو
ستجد في هذه المشاركة كيفية استخراج الـMac address من الـarp table
ya e5wany ana 3ayez tare2a a3red beha kol el ip's ely ma3aia online 3la el network zai el netcut keda
اخي الكريم حاول في المرة القادمة الكتابة باللغة العربية أو الإنجليزية ;) و حتى تسهل علينا فهم سؤالك ومساعدتك
يوجد طريقة سريعة يمكن من خلالها معرفة جميع الـIPs على الشبكة ومن ثم يمكننا استخراج الـMAC Address لكل IP وباستخدام الطريقة السابقة , وكما يلي :
// FADI Abdelqader , .Net Network, Distributed Systems & TCP/IP Book
// (C) www.fadidotnet.org
// 2006
using System;
using System.IO;
using System.Diagnostics;
using System.Net;
using System.Collections.Specialized;
public class Names
{
public StringCollection GetNames()
{
ProcessStartInfo _startInfo = new ProcessStartInfo("net","view");
_startInfo.CreateNoWindow = true;
_startInfo.UseShellExecute = false;
_startInfo.RedirectStandardOutput = true;
Process _process = Process.Start(_startInfo);
StreamReader _reader = _process.StandardOutput;
StringCollection _machineNames = GetMachineNamesFromProcessOutput(_reader.ReadToEnd());
StringCollection _machineIPs = new StringCollection();
foreach(string machine in _machineNames)
{
_machineIPs.Add(IPAddresses(machine));
}
return _machineIPs;
}
private static string IPAddresses(string server)
{
try
{
System.Text.ASCIIEncoding ASCII = new System.Text.ASCIIEncoding();
// Get server related information.
IPHostEntry heserver = Dns.Resolve(server);
//assumin the machine has only one IP address
return heserver.AddressList[0].ToString();
}
catch
{
return "Address Retrieval error for " + server;
}
}
//string manipulations
private StringCollection GetMachineNamesFromProcessOutput(string processOutput)
{
string _allMachines = processOutput.Substring( processOutput.IndexOf("\\"));
StringCollection _machines= new StringCollection();
while(_allMachines.IndexOf("\\") != -1 )
{
_machines.Add(_allMachines.Substring(_allMachines.IndexOf("\\"),
_allMachines.IndexOf(" ",_allMachines.IndexOf("\\")) - _allMachines.IndexOf("\\")).Replace("\\",String.Empty));
_allMachines = _allMachines.Substring(_allMachines.IndexOf(" ",_allMachines.IndexOf("\\") + 1));
}
return _machines;
}
}
public class Runner
{
static void Main()
{
Names _names = new Names();
StringCollection names = _names.GetNames();
foreach(string name in names)
{
Console.WriteLine(name);
GetMac ff = new GetMac ();
Console.WriteLine(ff.Get_Mac (name));
}
Console.ReadLine();
}
}
public class GetMac
{
public string Get_Mac(string IP)
{
string str1=String.Empty;
try
{
string str2=String.Empty;
ProcessStartInfo info1 = new ProcessStartInfo();
Process process1 = new Process();
info1.FileName = "nbtstat";
//info1.RedirectStandardInput = false;
info1.RedirectStandardOutput = true;
info1.Arguments = "-A " + IP;
info1.UseShellExecute = false;
process1 = Process.Start(info1);
int num1 = -1;
while (num1 <= -1)
{
num1 = str2.Trim().ToLower().IndexOf("mac address", 0);
if (num1 > -1)
{
break;
}
str2 = process1.StandardOutput.ReadLine();
}
process1.WaitForExit();
str1 = str2.Trim();
}
catch (Exception exception2)
{
throw exception2;
}
return str1;
}
}تم تعديل هذه المشاركة بواسطة fmo_82 في 13 أكتوبر 2006 في 04:23
mosh 3arif a2olak eh ya basha teslam edk ya fmo begad ana gebt el asamimen el net view bas kont badwar 3ala el ip thx awi
هذا الموضوع مغلق.
