[Mono-aspnet-list] URGENT HELP C# + DEBIAN
uaaron at hotmail.it
Thu Jul 12 19:33:33 UTC 2012
Hey guys! I urgently need your help Ok so what im trying to do is this: *
i have a debian server and i saved its mac address on a txt file in the usr
folder. What i want to do is that every time i start the machine the script
i'm trying to do should check the current mac address and compare it to the
one saved on the txt file. If they don't match than the machine should
*I'm not very familiar with debian so i programmed the script in c#..it
looks like this
static void Main(string args)
string newmc = Convert.ToString(GetMacAddress()); //current mac
string mc = File.ReadAllText(@"/usr/mc.txt"); //mac address
saved on a txt file previously
if (newmc != mc) //shutdown if the mac addresses dont match
System.Diagnostics.Process.Start("shutdown.exe", "-s -t 0");
static string GetMacAddress()
string macAddresses = "";
foreach (NetworkInterface nic in
// Only consider Ethernet network interfaces, thereby
// loopback devices etc.
if (nic.NetworkInterfaceType !=
if (nic.OperationalStatus == OperationalStatus.Up)
macAddresses += nic.GetPhysicalAddress().ToString();
THAN what i created a txt file containing the code and i renamed in
shutdown.cs and transferred it on debian machine.
*When i run the mcs shutdown.cs command i get this error : CS0234: The type
or namespace name 'NetworkInformation' does not exist i the namespace
'System.Net'. Are you missing an assembly reference?*
I don't know what to do guys as i said i'm not very familiar with debian nor
with mono honestly..if you guys could help me out would be fantastic.
View this message in context: http://mono.1490590.n4.nabble.com/URGENT-HELP-C-DEBIAN-tp4650386.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-aspnet-list