C#检查系统是否支持HttpListener

作者: 吴杰 分类: 编程 发布时间: 2016-12-29 23:41

C#检查系统是否支持HttpListener

// 检查系统是否支持
if (!HttpListener.IsSupported)
{
    throw new System.InvalidOperationException("必须为 Windows XP SP2 或 Server 2003 以上系统!");
}