using System;
using System.Collections.Generic;
using System.Text;
namespace Core
{
public class WebTool
{
/// <summary>
/// 获取本机IP
/// </summary>
/// <returns></returns>
private static string GetComputerIP()
{
System.Net.IPHostEntry iph = System.Net.Dns.GetHostEntry(Environment.MachineName);
return iph.AddressList[0].ToString();
}
/// <summary>
/// 判断本机是否位于局域网内
/// </summary>
/// <returns></returns>
public static int CheckComputerLocation()
{
string _ip = GetComputerIP();
if (_ip != "192.168.1.58")
{
return 0;
}
else
{
return 1;
}
}
}
}