/// <Summary>
///Obtain the computer CPU serial number
/// </Summary>
Public String getcomputercpuserialno ()
{
String cpuserialno = string. empty;
System. Management. managementclass = new system. Management. managementclass ("win32_processor ");
System. Management. managementobjectcollection = managementclass. getinstances ();
Foreach (system. Management. managementobject in managementobjectcollection)
{
Cpuserialno = managementobject. properties ["processorid"]. value. tostring ();
Break;
}
Return cpuserialno;
}
/// <Summary>
///Obtain the Client IP Address
/// </Summary>
Public String getclientidaddress ()
{
String IP = string. empty;
Try
{
If (system. Web. httpcontext. Current. Request. servervariables ["http_x_forwarded_for"] = NULL)
IP = system. Web. httpcontext. Current. Request. servervariables ["remote_addr"]. tostring ();
Else
IP = system. Web. httpcontext. Current. Request. servervariables ["http_x_forwarded_for"]. tostring ();
If (string. isnullorempty (IP )){
IP = system. Web. httpcontext. Current. Request. userhostaddress;
}
}
Catch {IP = "1.1.1.1 ";}
Return IP;
}