随笔-13  评论-71  文章-1  trackbacks-0
  2011年9月13日
摘要: 需要使用支持html5的浏览器才能看到矢量图阅读全文
posted @ 2011-09-13 07:16 C# hack 阅读(112) 评论(0) 编辑
  2008年7月11日
摘要: Method Active Constructor Always Construct Always TestDeviceFilter Always AddParsedSubObject Always DeterminePostBackMode Always OnPreInit Always LoadPersonalizationData Always InitializeThemes Always...阅读全文
posted @ 2008-07-11 03:41 C# hack 阅读(699) 评论(0) 编辑
  2006年9月26日
最近在写个小工具的时候需要通过网址得到域名,不知道怎么Uri里只有得到主机名的方法而没有得到域名的方法,于是只有自己实现一个,但是我感觉这个方法比较变态,希望拿出来和大家一起讨论下,看看有没有更好的方法?

例如:http://www.google.co.uk,应该返回google.co.uk,http://www.test.googlepages.com,应该返回googlepages.com

我的程序如下,拿出来讨论下,写的比较弱智,必须预先知道所有的域名后缀。
请大家告诉我好的方法:

private string GetDomain(string url)
        {
            
string host;
            Uri uri;
            
try
            {

                uri 
= new Uri(url);
                host 
= uri.Host + " ";
            }
            
catch
            {
                
return "";
            }

            
string[] BeReplacedStrs = new string[] { ".com.cn"".edu.cn"".net.cn"".org.cn"".co.jp"".gov.cn"".co.uk""ac.cn"".edu"".tv"".info"".com"".ac"".ag"".am"".at"".be"".biz"".bz"".cc"".cn"".com"".de"".es"".eu"".fm"".gs"".hk"".in"".info"".io"".it"".jp"".la"".md"".ms"".name"".net"".nl"".nu"".org"".pl"".ru"".sc"".se"".sg"".sh"".tc"".tk"".tv"".tw"".us"".co"".uk"".vc"".vg"".ws"".il"".li"".nz" };

            
foreach (string oneBeReplacedStr in BeReplacedStrs)
            {
                
string BeReplacedStr = oneBeReplacedStr + " ";
                
if (host.IndexOf(BeReplacedStr) != -1)
                {
                    host 
= host.Replace(BeReplacedStr, string.Empty);
                    
break;
                }
            }

            
int dotIndex = host.LastIndexOf(".");
            host 
= uri.Host.Substring(dotIndex + 1);
            
return host;
        }

谢谢了!
posted @ 2006-09-26 00:56 C# hack 阅读(2047) 评论(16) 编辑
  2006年9月15日

Failure to install Toolbox controls via ContentInstaller or Tools.InstallCommunityControls

If you have the SQL Server Management Studio Express CTP or SQL Server 2005, then it is overwriting some registry key settings. The workaround for this is:

  1. Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\{36839529-3AF3-47fa-8194-F4A3FA9F0ED7}change the CodeBase value to use the Visual Studio 8.0 location, for e.g. file:///D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\Microsoft.VisualStudio.ToolBoxControlInstaller.dll
  2. Under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\{36839529-3AF3-47fa-8194-F4A3FA9F0ED7}\SatelliteDll, change the Path value to point to the Common7\IDE folder for e.g. D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\
  3. Open the Visual Studio Command Prompt and run devenv /setup
posted @ 2006-09-15 01:45 C# hack 阅读(408) 评论(0) 编辑
  2006年6月7日

private static string ConvertToAbsoluteUrls (string html, Uri relativeLocation) {
    IHTMLDocument2 doc = new HTMLDocumentClass ();
    doc.write (new object [] { html });
    doc.close ();

    foreach (IHTMLAnchorElement anchor in doc.links) {
        IHTMLElement element = (IHTMLElement)anchor;
        string href = (string)element.getAttribute ("href", 2);
        if (href != null) {
            Uri addr = new Uri (relativeLocation, href);
            anchor.href = addr.AbsoluteUri;
        }
    }

    foreach (IHTMLImgElement image in doc.images) {
        IHTMLElement element = (IHTMLElement)image;
        string src = (string)element.getAttribute ("src", 2);
        if (src != null) {
            Uri addr = new Uri (relativeLocation, src);
            image.src = addr.AbsoluteUri;
        }
    }

    string ret = doc.body.innerHTML;

    return ret;
}

posted @ 2006-06-07 00:03 C# hack 阅读(1206) 评论(8) 编辑
  2006年5月9日
摘要: 一直听说TaskVision这个任务跟踪工具不错,而且开源,公司目前任务管理比较混乱,所以今天打算安装起来,但是安装过程老是出错,所以只有自己手动安装! 进入http://www.windowsforms.net/TaskVision/下载C# TaskVision - Now in C#!!! - This package contains the TaskVision source code ...阅读全文
posted @ 2006-05-09 18:02 C# hack 阅读(1765) 评论(10) 编辑
  2006年1月24日
摘要: 多听别人的想法,少说自己的主意。主意太多让人无所适从,增强了别人的挫折感。多启发别人的思维,少说自己的决定。人是被自己激励的,不是被他人驱使的。多进行一件事情的深化,少被新的事情和新的想法激动得彻夜难眠。一个人和一个企业的资源是有限的,想法比资源多,会让自己和企业陷入被动。无数的事情和想法,只会让企业的战略越来越模糊、越大而无当。多考虑执行,少考虑战略。确定一个战略,必须结合企业有没有合适的人在合...阅读全文
posted @ 2006-01-24 14:30 C# hack 阅读(312) 评论(0) 编辑
  2005年12月15日
摘要: 大四时为www.gameres.com写的一篇文章  各位朋友大家好,嗷嗷,我第一次在这里发文章,好高兴,本人技术有限,不要笑话,如有错误请您告诉我一声。   刚才我玩了几把疯狂坦克,输了好几盘,觉得无聊就搞搞这个,下面开始说说如何得到游戏中的动态数据(地址改变),以得到疯狂坦克中坦克X坐标为例----------------------------------------------------...阅读全文
posted @ 2005-12-15 21:59 C# hack 阅读(1819) 评论(0) 编辑
  2005年12月14日
摘要: 在网上找到大三写的一篇文章,保存到Blog留做纪念!《汇编编写 可以自启动的磁盘》下面贴出了两段代码boot.asm 和shell.asm,实现磁盘启动,并且解析了两个命令 time 和 reboot,有兴趣的朋友可以看看。由于本人的汇编知识很菜,这篇文章只是让大家看看磁盘启动是如何实现的,如果有错误的地方,大家能够指出那就太谢谢了步骤:放入一张磁盘,把这两段代码编译成EXE,分别执行一次,重启计...阅读全文
posted @ 2005-12-14 22:29 C# hack 阅读(898) 评论(0) 编辑
摘要: 今天看到Google PageRank ChecksumPHP代码才发现上次发布的库写的很烂,我根本没有去理解里面的意思,有很多函数是没有必要的,如<< >>位操作都已经是现成的,我怎么还照着vb代码改写,真是愚蠢。  为了弥补我的愚蠢,把php代码改编成的.net库,发布出来。  Google PageRank 链接库下载地址:  Google PageRank .net...阅读全文
posted @ 2005-12-14 22:18 C# hack 阅读(3549) 评论(13) 编辑
昵称:C# hack
园龄:6年3个月
粉丝:0
关注:1
<2012年1月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

搜索

 
 

常用链接

随笔分类

随笔档案

相册

activex

Atlas

Crack&Exploit

Google

P2P

分布式计算(网格)

分析器

每日关注

收藏网站

网络监听

稀奇古怪

与我相关

最新评论

阅读排行榜

评论排行榜

推荐排行榜