|
I have error in programming!
so I need your asistance.
desciption:
QuangLam
|
|
|
|
|
I have been trying to solve on how to detect IP addresses based on my installed printer drivers around my network but I am getting frustrated each day..heheh.. Win32_Printer, Win32_NetworkAdapter and Win32_TCPIPPrinter failed to get the information that I want..
if you're kind enough share your knowledge to email it to me at janverge@gmail.com
I am using C# as well.
nice one..
|
|
|
|
|
If we invoke a function of Windows, so in other OSs we cannot get MAC.
How can we get MAC address of other OSs (Linux, Solaris...)?
Is there any method that is transparent with the operating system?
Thanks.
Minh
|
|
|
|
|
Hi,
I did this Application in Dotnet. I don't think there is the support aviable for all these OS in Dotnet.
Thanks,
Mahendran.G
Mahendran. G
Sr. Software Engg.
Satyam computer Services,
Chennai, India.
|
|
|
|
|
Hi Mahendran,
I intend to develop a web-based application for using in our local network.
The website will get MAC address of client machine whenever there is a request in order to do some checking. The client machines can be any kind of Windows, Solaris, Linux OSs; the server is Windows server 2003.
To obtain MAC address of client machine, I intend to use the function SendARP. I tried in machines with Windows OS and it ran well.
But how about with others non-Windows OS? Do you think that the website can also take MAC address of client who uses these OSs to access?
Where will this function be invoked ? In server or in client? If it runs on server (Windows 2003) I think it can
Minh
|
|
|
|
|
Hi Minh,
You clearly mentioned that, You are going to working in the local network, fine then. It should be in the Server side function. In Server side you can get the IP address of the Client which requesting web page (i know it is possible in Dotnet). For the IP address you can get the MAC using the Any Server Functions (if it is a windows server this functions also will work).
Regards,
Mahendran.G
Mahendran. G
Sr. Software Engg.
Satyam computer Services,
Chennai, India.
|
|
|
|
|
Hi Mr. MahendranG,
do u know how to get the MAC Address from the NIC Hardware not from a place that can be changed.
May god give u good health and knowledge.
|
|
|
|
|
i notice that you are querying for hostname or machine name first(active directory, domainentry, etc) and then getting the IP Address of each machine.
I wanted to know if you can do the other way around.
For one of my projects i tried using
Dns.GetHostEntry(IPAddress)
this gave me back the IpAddress as hostname in the IPpHostEntry variable and not the actual machine name.
plz help!
|
|
|
|
|
If You r able to Get the Ipadrress, you can resolve the ipaddress with the hos name. If You get the IP Address, Please try to check the syntax and convert it into the Hostname using the resole Method.
Very long back i invest time for this. So i am not able to give exact solution for this. Sorry
Mahendran. G
Sr. Software Engg.
Trnasact Solution,
Chennai
|
|
|
|
|
thanx 4 the reply...
anyways... the above problem turns out to be a microsoft bug in the windows Xp, which they will fix in windows vista... found that after racking my brains for a long time on this!!
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=97815
|
|
|
|
|
I have tried you code and it really good in a LAN. But when I use SendARP to recieve MAC address of an IP from internet, it doesn't work.
The returing MAC Address always be 00-00-00-00-00-00
I wonder that, does SendARP work only in a local netowrk? In this case, do you know any solution for my problem?
Thanks for your help!
dathq
|
|
|
|
|
there is no way you can see the mac addres over internet becouse this mac addres is remove in every step in the path from router to router and is replaced with the mac addres of the router sending the packet and the mac addres of the router that receives
sorry for my english i hope this is a good explination
|
|
|
|
|
Hi,
Currently this does not retrieve the MAC Address of PC's that are turned off, could this be retrieved?
Thanks
|
|
|
|
|
KevinReece,
I think it is not possible, How you get information form the person who's already died. This is not avialable in the servers also.
Mahendran. G
Sr. Software Engg.
Trnasact Solution,
Chennai
|
|
|
|
|
Hello,
This is a really nice project! Is there a VB.NET 2005 example so that I can work with it? I'm not any good on C#.
|
|
|
|
|
hi,
i didn't started with 2005 Examples, I will post it as early as possible
Mahendran. G
Sr. Software Engg.
Transact Solution pvt Ltd,
Chennai
-- modified at 23:14 Monday 10th April, 2006
|
|
|
|
|
Thank you so much Mahendran!
|
|
|
|
|
A mi me compiló así, aun keda pendiente el tema del IpAddress Obsoleto :s.
IPHostEntry IP = Dns.GetHostEntry(Mac);<br />
MessageBox.Show(IP.AddressList[0].ToString());<br />
string strIp= "", maca="";<br />
<br />
foreach(IPAddress TempA in IP.AddressList)<br />
{<br />
strIp = TempA.Address.ToString();<br />
byte[] ab = new byte[6];<br />
int len = ab.Length;<br />
int r = SendARP( (int) TempA.Address, 0, ab, ref len );<br />
maca = BitConverter.ToString( ab, 0, 6 );<br />
MessageBox.Show(maca);
}
|
|
|
|
|
sendARP does not let you to resolve the mac address from a hostname on another subnet.
I had to manage that with running a process nbtstat -a <hostname> or nbtstat -A <ipaddress>
|
|
|
|
|
excellent
but you do hard coding the workgroup name such as 'Baba' in your case.
how can i do programatically the same i.e. I want to retrieve the workgroup name programatically.
please if you know then inform me.
thaks a lot
rizwan
|
|
|
|
|
you can trough WMI
using System;
using System.Management;
using System.Windows.Forms;
namespace WMISample
{
public class MyWMIQuery
{
public static void Main()
{
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2", "SELECT Workgroup FROM Win32_ComputerSystem");
foreach (ManagementObject queryObj in searcher.Get())
{
MessageBox.Show("Workgroup: " + queryObj["Workgroup"]);
}
}
catch (ManagementException e)
{
MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);
}
}
}
}
|
|
|
|
|
hi,
the above demo projects works fine if machines are in domain
but doesnot when machine are in workgroup
but throughing no error
-- modified at 9:50 Wednesday 5th September, 2007
|
|
|
|
|
Hey rizwan, I noticed that in private void InitializeComponent(), TxtWorkGroup you can change the name of the group to whatever you want.
|
|
|
|
|
do you know how i can retrieve all the network hosts (ip and/or mac) on my wireless network?
|
|
|
|
|