当前位置:网站首页>Methods for obtaining some information of equipment
Methods for obtaining some information of equipment
2022-06-25 06:14:00 【weixin_ forty-three million seven hundred and fifty-four thousa】
Get the system Ip
public enum ADDRESSFAM
{
IPv4, IPv6
}
/// <summary>
/// Get local IP
/// </summary>
/// <param name="Addfam"> To obtain the IP type </param>
/// <returns></returns>
public string GetIP(ADDRESSFAM Addfam)
{
if (Addfam == ADDRESSFAM.IPv6 && !Socket.OSSupportsIPv6)
{
return null;
}
string output = "";
foreach (NetworkInterface item in NetworkInterface.GetAllNetworkInterfaces())
{
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
NetworkInterfaceType _type1 = NetworkInterfaceType.Wireless80211;
NetworkInterfaceType _type2 = NetworkInterfaceType.Ethernet;
if ((item.NetworkInterfaceType == _type1 || item.NetworkInterfaceType == _type2) && item.OperationalStatus == OperationalStatus.Up)
#endif
{
foreach (UnicastIPAddressInformation ip in item.GetIPProperties().UnicastAddresses)
{
//IPv4
if (Addfam == ADDRESSFAM.IPv4)
{
if (ip.Address.AddressFamily == AddressFamily.InterNetwork)
{
output = ip.Address.ToString();
//Debug.Log("IP:" + output);
}
}
//IPv6
else if (Addfam == ADDRESSFAM.IPv6)
{
if (ip.Address.AddressFamily == AddressFamily.InterNetworkV6)
{
output = ip.Address.ToString();
}
}
}
}
}
return output;
}

边栏推荐
- RM command – remove file or directory
- JS implementation mouse can achieve the effect of left and right scrolling
- Mount command - file system mount
- Understanding of process, thread, task queue, event loop, macro task, micro task, execution stack and other concepts in JS
- Click to send text messages without response is a common problem for many users in building the elegant grass Dragonfly Q system - solve the problem of clicking to send text messages without response
- Some common errors and solutions of using SAP ui5 to consume OData services
- Jz-066- motion range of robot
- TFTP command – uploading and downloading files
- MV command – move or rename files
- What is the use of the subprocess module
猜你喜欢

Soft exam information system project manager_ Information system security management - Senior Information System Project Manager of soft test 026
Introduction to sap ui5 tools
Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware

Mongodb basic concept learning - Documentation

MySQL tuning -- 02 -- slow query log
SAP ui5 application development tutorial 32 - how to create a custom SAP ui5 control

What is the use of the subprocess module
![[Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security](/img/52/7dedc5b6e213839fbf5cee3963ac99.jpg)
[Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security
![[data visualization application] draw spatial map (with R language code)](/img/2d/04e5015573d10bdd6325ae497bfeb3.jpg)
[data visualization application] draw spatial map (with R language code)
Websocket in the promotion of vegetable farmers
随机推荐
[interview with a large factory] meituan had two meetings. Was there a surprise in the end?
Processes and threads - concepts and process scheduling
Copying DNA
SAP ui5 tutorial for beginners part XXVI - detailed steps for using OData service with mock server trial version
Mongodb basic concept learning - Documentation
Day21 JMeter usage basis
SAP ui5 Application Development Tutorial Part 30 - parameter transfer in the routing process of SAP ui5
Research Report on demand and Competitive Prospect of global and Chinese welding personal protective equipment industry 2022-2027
The sum problem
Some common errors and solutions of using SAP ui5 to consume OData services
Hands on deep learning (III)
Count the grid
Technology Review: Interpretation of cloud native architecture trend in 2022
Interview experience - list of questions
Aiot project that is an introduction to the basics of the Internet of things and can be implemented in practice
Soft exam information system project manager_ Management Science (Operations Research) 2--- senior information system project manager of soft test 034
Lesson 9: workspace introduction
Tail command – view the contents at the end of the file
Wind farm visualization: wind farm data
Summary of 6 common methods of visual deep learning model architecture