获取MAC地址并将其写入cookie [英] Getting MAC address and writing it to cookie
问题描述
我们需要创建一个Windows应用程序/服务,它会定期将机器MAC地址写入cookie。是否有可用的源代码/相同的线程?
Hi kmore,
>>我们需要创建一个Windows应用程序/服务,定期将机器MAC地址写入cookie。
我们可以将您的需求分成两部分,获取Mac地址,然后将其存储在cookie中。 / p>
您的项目类型是什么?对于cookie,它是相对于Web Project,你要存储哪个cookie?
我建议你尝试下面的代码来检索Mac。
var macAddr =
(来自NetworkInterface.GetAllNetworkInterfaces中的nic的
其中nic.OperationalStatus == OperationalStatus.Up
select nic.GetPhysicalAddress()。ToString ()
).FirstOrDefault();
最好的问候,
Tao Zhou
We need to create a windows application/service that will periodically write machines MAC address to cookie. Is there any source code/same thread available?
Hi kmore,
>> We need to create a windows application/service that will periodically write machines MAC address to cookie.
We could split your requirement into two parts, getting Mac address and then store it in cookie.
What is your project type? For cookie, it is relative to Web Project, which cookie do you want to store?
I suggest you try code below to retrieve Mac.
var macAddr = ( from nic in NetworkInterface.GetAllNetworkInterfaces() where nic.OperationalStatus == OperationalStatus.Up select nic.GetPhysicalAddress().ToString() ).FirstOrDefault();Best Regards,
Tao Zhou
这篇关于获取MAC地址并将其写入cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!