存档

‘c#’ 分类的存档

优化一句替换一段句子

2012年1月11日 云飞扬 没有评论

select top 1 aa from table where classid="+classid+" order by NEWID()

分类: c# 标签:

调用ip138的页面获取IP地址

2011年6月27日 云飞扬 1 条评论

调用ip138的IP获取IP地址 string pagehtml = RESTCommand.htmlGetter(@"http://www.ip138.com/ip2city.asp", "", "gb2312", false, null, null);

分类: c# 标签: ,

Linux(Ubuntu)如何搭建C#开发环境

2011年1月16日 云飞扬 评论已被关闭

如 果平时主要开发控制台类、组件、后端服务等程序,可以尝试在Linux类操作系统下搭建C#.Net开发环境,好处是在Linux环境里你不用担心朋友或同事拿你的电脑来玩魔兽世界或者一不小心被装了一大堆流氓软件 ;-) 先看看本篇文章最终效果:在 Ubuntu 里跑的开发环境 MonoDevelop:。。。

分类: c#, ubuntu linux 标签: ,

Linux(Ubuntu)如何搭建C#开发环境

2011年1月16日 云飞扬 评论已被关闭

如 果平时主要开发控制台类、组件、后端服务等程序,可以尝试在Linux类操作系统下搭建C#.Net开发环境,好处是在Linux环境里你不用担心朋友或同事拿你的电脑来玩魔兽世界或者一不小心被装了一大堆流氓软件 ;-) 先看看本篇文章最终效果:在 Ubuntu 里跑的开发环境 MonoDevelop:。。。

分类: c#, ubuntu linux 标签: ,

重装IIS 7.5 ASP.NET 4.0命令及HTTP 错误 404.17 - Not Found

2010年12月5日 云飞扬 没有评论

重装IIS 7.5 ASP.NET 4.0命令cmd
"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe" -iru -enable
错误问题如下:

分类: asp.net, c# 标签: ,

验证视图状态 MAC 失败的错误bug

2010年12月4日 云飞扬 没有评论

一般加enableEventValidation="false" viewStateEncryptionMode ="Never" 但不行
原来随便测试代码中form runat="server"+action加 button服务器包含html,导致产生标题错误,去掉。。。。。

分类: c# 标签: ,

Directory.EnumerateFiles的使用

2010年11月14日 云飞扬 评论已被关闭

?View Code CSHARPusing System; using System.Collections.Generic; using System.Linq; using System.IO;   class Program { static void Main(string[] args) { try { // LINQ query for all files containing the word 'Europe'. var files = from file in Directory.EnumerateFiles(@"\\archives1\library\") where file.ToLower().Contains("europe") select file;   // Show results. foreach (var file in files) { Console.WriteLine("{0}", file); } [...]

分类: c# 标签: ,

C#读取文本文件小结

2010年10月4日 云飞扬 没有评论

ReadLine读取一行,ReadToEnd全部读取, while(sr.Peek()>-1) //还有数据 ,例子如下:

分类: c# 标签: ,

C#有用代码 Application.DoEvents()

2010年10月3日 云飞扬 3 条评论

有时对代码一片空白,博客上还是Copy份
bool loading = true;
for (int i = 0; i < list.Count; i++)

分类: c# 标签: ,

合并如何2个相同的List

2010年10月2日 云飞扬 没有评论

合并2个相同的List采用List.AddRange() 方法如下:

分类: c# 标签: , ,

C#据说最简单的List排序方法

2010年9月28日 云飞扬 4 条评论

List如果用Compare要用一大堆东西,用委托可以使用很少的代码实现如下:
List<实体类> List1=....;//获取List1

分类: c# 标签: ,

C#常用泛型数组应用

2010年9月27日 云飞扬 没有评论

常用泛型数组应用如下:

?View Code CSHARP
List<string> list= new List<string>(s.Trim().Split(new string[] { "," }, 
StringSplitOptions.RemoveEmptyEntries));
分类: c# 标签: ,

VS2010中CopySourceAsHtml 安装失败

2010年9月24日 云飞扬 没有评论

拷贝CopySourceAsHtml.AddIn,JTLeigh.Tools.Development.CopySourceAsHtml.dll 到VS2010目录下
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Addins
修改CopySourceAsHtml.AddIn如下:但是VS2010仍然失败,启动VS2010无响应,CPU站49%,修改文件如下:

分类: c# 标签:

BitArray和BitVector32的使用

2010年9月23日 云飞扬 没有评论

具体看代码和注释如下:

分类: c# 标签: , ,

ASP.NET最新重要安全漏洞Security Vulnerability解决方案

2010年9月18日 云飞扬 1 条评论

本文主要参考scottgu的文章的解决方法,文章大致意思就是使用自定错误,