string thehost= HttpContext.Current.Request.Url.Host.ToString();
if (thehost != "www.abcd.com") //www.abcd.com为授权网站,如果不是授权网站检测是不是在本机浏览的
{
if (thehost != "localhost") //如果不是在本机浏览,直接获取官方网站的授权网站列表
{
WebClient wc = new WebClient();
wc.Credentials = CredentialCache.DefaultCredentials;
byte[] pageData = wc.DownloadData("http://www.microsoft.com/power/power.html");
string checkpower = Encoding.Default.GetString(pageData);
wc.Dispose();
if (checkpower.IndexOf(thehost) > -1)
{
//获取得到数据,允许
}
else
{
Response.write("请使用我们的正版软件");
}
}
}请各位大哥说说这个方法行不行啊?
要是行怎么加密这个dll啊?谢谢
if (thehost != "www.abcd.com") //www.abcd.com为授权网站,如果不是授权网站检测是不是在本机浏览的
{
if (thehost != "localhost") //如果不是在本机浏览,直接获取官方网站的授权网站列表
{
WebClient wc = new WebClient();
wc.Credentials = CredentialCache.DefaultCredentials;
byte[] pageData = wc.DownloadData("http://www.microsoft.com/power/power.html");
string checkpower = Encoding.Default.GetString(pageData);
wc.Dispose();
if (checkpower.IndexOf(thehost) > -1)
{
//获取得到数据,允许
}
else
{
Response.write("请使用我们的正版软件");
}
}
}请各位大哥说说这个方法行不行啊?
要是行怎么加密这个dll啊?谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货