Click here to Skip to main content
15,894,540 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerI was wrong a long time ago Pin
Ennis Ray Lynch, Jr.14-Jan-10 7:55
Ennis Ray Lynch, Jr.14-Jan-10 7:55 
AnswerRe: How to get mac address of a client system in asp.net Pin
Abhishek Sur14-Jan-10 10:09
professionalAbhishek Sur14-Jan-10 10:09 
QuestionRe: How to get mac address of a client system in asp.net Pin
mithun narayanan17-Jan-10 16:43
mithun narayanan17-Jan-10 16:43 
AnswerRe: How to get mac address of a client system in asp.net Pin
April Fans14-Jan-10 22:24
April Fans14-Jan-10 22:24 
GeneralRe: How to get mac address of a client system in asp.net Pin
mithun narayanan17-Jan-10 16:52
mithun narayanan17-Jan-10 16:52 
GeneralRe: How to get mac address of a client system in asp.net Pin
Abhishek Sur17-Jan-10 21:23
professionalAbhishek Sur17-Jan-10 21:23 
GeneralRe: How to get mac address of a client system in asp.net Pin
mithun narayanan18-Jan-10 7:03
mithun narayanan18-Jan-10 7:03 
AnswerRe: How to get mac address of a client system in asp.net Pin
April Fans17-Jan-10 16:36
April Fans17-Jan-10 16:36 
Hi, you can refer to the following code:

[DllImport("Iphlpapi.dll")]
private static extern int SendARP(Int32 dest,Int32 host,ref Int64 mac,ref Int32 length);
[DllImport("Ws2_32.dll")]
private static extern Int32 inet_addr(string ip);

private void Page_Load(object sender, System.EventArgs e)
{
// initial page
try
{
string userip=Request.UserHostAddress;
string strClientIP = Request.UserHostAddress.ToString().Trim();
Int32 ldest = inet_addr(strClientIP); //client ip
Int32 lhost = inet_addr(""); //server ip
Int64 macinfo = new Int64();
Int32 len = 6;
int res = SendARP(ldest,0, ref macinfo, ref len);
string mac_src=macinfo.ToString("X");
if(mac_src == "0")
{
if(userip=="127.0.0.1")
Response.Write ("Localhost!");
else
Response.Write ("welcome IP = " + userip + "<br>");
return;
}

while(mac_src.Length<12)
{
mac_src = mac_src.Insert(0,"0");
}

string mac_dest="";

for(int i=0;i<11;i++)
{
if (0 == (i % 2))
{
if ( i == 10 )
{
mac_dest = mac_dest.Insert(0,mac_src.Substring(i,2));
}
else
{
mac_dest ="-" + mac_dest.Insert(0,mac_src.Substring(i,2));
}
}
}

Response.Write ("welcome IP = "+userip+ "<br>" + ",MAC = "+mac_dest

+ "<br>");
}
catch(Exception err)
{
Response.Write(err.Message);
}
}
April

Comm100 - Leading Live Chat Software Provider


modified 27-May-14 8:54am.

GeneralRe: How to get mac address of a client system in asp.net Pin
mithun narayanan17-Jan-10 16:53
mithun narayanan17-Jan-10 16:53 
QuestionAdd multiple values from the textbox into one cell (column) in Gridview Pin
Nopo14-Jan-10 3:57
Nopo14-Jan-10 3:57 
AnswerRe: Add multiple values from the textbox into one cell (column) in Gridview Pin
Not Active14-Jan-10 4:46
mentorNot Active14-Jan-10 4:46 
QuestionDoes anyone use the gsoap Pin
Fired.Fish.Gmail14-Jan-10 2:39
Fired.Fish.Gmail14-Jan-10 2:39 
AnswerRe: Does anyone use the gsoap Pin
Fired.Fish.Gmail14-Jan-10 15:01
Fired.Fish.Gmail14-Jan-10 15:01 
QuestionDynamic Template control and value persistence Pin
Shivan Nandan14-Jan-10 1:43
Shivan Nandan14-Jan-10 1:43 
AnswerRe: Dynamic Template control and value persistence Pin
Shivan Nandan14-Jan-10 19:05
Shivan Nandan14-Jan-10 19:05 
GeneralRe: Dynamic Template control and value persistence Pin
Ashfield14-Jan-10 21:32
Ashfield14-Jan-10 21:32 
AnswerRe: Dynamic Template control and value persistence Pin
April Fans14-Jan-10 22:19
April Fans14-Jan-10 22:19 
GeneralRe: Dynamic Template control and value persistence Pin
Shivan Nandan14-Jan-10 22:28
Shivan Nandan14-Jan-10 22:28 
Question32 bit dll issue on 64 bit Production Server Pin
Jeneesh K. Velayudhan13-Jan-10 23:01
Jeneesh K. Velayudhan13-Jan-10 23:01 
AnswerRe: 32 bit dll issue on 64 bit Production Server Pin
Brij13-Jan-10 23:24
mentorBrij13-Jan-10 23:24 
GeneralRe: 32 bit dll issue on 64 bit Production Server Pin
Jeneesh K. Velayudhan17-Jan-10 18:18
Jeneesh K. Velayudhan17-Jan-10 18:18 
AnswerRe: 32 bit dll issue on 64 bit Production Server Pin
The Man from U.N.C.L.E.14-Jan-10 4:12
The Man from U.N.C.L.E.14-Jan-10 4:12 
GeneralRe: 32 bit dll issue on 64 bit Production Server Pin
Jeneesh K. Velayudhan17-Jan-10 18:23
Jeneesh K. Velayudhan17-Jan-10 18:23 
QuestionDeploy web application in to IIS 7 Pin
Sagar.H.Mistry13-Jan-10 20:08
Sagar.H.Mistry13-Jan-10 20:08 
AnswerRe: Deploy web application in to IIS 7 Pin
Sathesh Sakthivel13-Jan-10 21:37
Sathesh Sakthivel13-Jan-10 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.