空军

skyiv studio

导航

随笔分类 -  C# Base

根据URL提取页面的Title,根据网页的charset自动判断Encoding
摘要:usingSystem;usingSystem.Net;usingSystem.Text;usingSystem.Text.RegularExpressions;classProgram{//获取网页的HTML内容,根据网页的charset自动判断EncodingstaticstringGetHtml(stringurl){returnGetHtml(url,null);}//获取网页的HTML内... 阅读全文

posted @ 2008-06-08 17:20 空军 阅读(3185) 评论(4) 推荐(0) 编辑

MSDN“MidpointRounding 枚举”中文翻译有误
摘要:MSDN“MidpointRounding 枚举”中文翻译对AwayFromZero的说明搞反了。 阅读全文

posted @ 2008-03-07 19:27 空军 阅读(794) 评论(2) 推荐(0) 编辑

C# 2.0 新特性(泛型、可空类型)应用一例
摘要:1usingSystem;23classTest4{5staticvoidMain()6{7Console.WriteLine(Max(1));//输出:18Console.WriteLine(Max(.3,-.5));//输出:0.39Console.WriteLine(Max(0M,-3M,3.14M));//输出:3.1410Console.WriteLine(Max(9f,-1f,3.14... 阅读全文

posted @ 2008-01-29 20:38 空军 阅读(489) 评论(1) 推荐(0) 编辑

Google中国编程挑战赛第一轮
摘要:Google™ Code Jam 中国编程挑战赛第一轮2005年12月19日21时在线举行,3道难度不同的题目,分数各为250、500和1000,难度高的题目分数较高,编码时间75分钟。很不幸,我没能进入下一轮。:( 阅读全文

posted @ 2005-12-20 11:03 空军 阅读(1265) 评论(3) 推荐(0) 编辑

Google中国编程挑战赛资格赛
摘要:Google™ Code Jam 中国编程挑战赛资格赛2005年12月12日中午12时-13日中午12时在线举行,参赛者会抽到5组题中的1组,每组题有2道难度不同的题目,分数各为250和750,难度高的题目分数较高。参赛者有60分钟可以完成全部的2题或其中1题。我抽到的是第3组题,以237.97分的成绩晋级下一轮比赛,在入围的500名参赛者中排名第189位。 阅读全文

posted @ 2005-12-15 16:20 空军 阅读(972) 评论(1) 推荐(0) 编辑

数据库访问模块
摘要:C#封装的SQL Server数据库访问模块,可从该类继承,用于访问SQL Server数据库。对OleDb、Odbc和其他数据库,可仿此封装。 阅读全文

posted @ 2005-10-15 18:51 空军 阅读(584) 评论(4) 推荐(0) 编辑

在局域网内获取本机的外部IP
摘要:在局域网中, 仅凭本机的力量无法获得本机的外部IP, 必须登录到外网某个服务器, 那个服务器就知道你的IP, 然后你再取回来。 阅读全文

posted @ 2005-10-01 09:39 空军 阅读(9043) 评论(14) 推荐(0) 编辑

C#中直接调用VB.NET的函数,兼论半角与全角、简繁体中文互相转化
摘要:在C#项目中添加引用Microsoft.VisualBasic.dll, 可以在C#程序中直接使用VB.NET中丰富的函数 阅读全文

posted @ 2005-09-28 23:41 空军 阅读(5953) 评论(22) 推荐(1) 编辑

天书奇谈C#版
摘要:Here's a nice challange for people who THINK they know how to read other people's code... It's a small C# program. I know, I know, it doesn't look like it's gonna get compiled, but believe me, it does. Try to guess this program's output, then try to run it. You'll be amazed to see what it does! 阅读全文

posted @ 2005-09-21 20:32 空军 阅读(2002) 评论(13) 推荐(0) 编辑

一个Delphi写的DES算法, 翻译成C#
摘要:其实.NET Framework已经提供实现DES算法的类: System.Security.Cryptography.DESCryptoServiceProvider。之所以要把一个Delphi写的DES算法翻译成C#,是因为网友espnstar想用Delphi加密,C#解密。[原文] 阅读全文

posted @ 2005-09-19 21:54 空军 阅读(1233) 评论(1) 推荐(1) 编辑

C#中更改1维数组的大小
摘要:模拟Visual Basic的ReDim语句,C#实现,仅支持1维数组。 阅读全文

posted @ 2005-09-19 17:10 空军 阅读(2915) 评论(8) 推荐(0) 编辑

打印自己的程序C#版
摘要:For years, we gave the same programming test to every developer. It was a straightforward test that required no setup or external knowledge from manuals. The candidates were asked to write a program that could print its source to the screen exactly, without performing any file input. 阅读全文

posted @ 2005-09-19 09:45 空军 阅读(642) 评论(1) 推荐(0) 编辑