All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
js代码小记(判断textbox的长度,并且固定最多收入字符)_JavaScript技术_编程技术
Asp.net与SQL一起打包部署安装_[Asp.Net教程]
EditPlus+NAnt构建轻巧的.NET开发环境_[Asp.Net教程]
ASP.Net分页控件发布_[Asp.Net教程]
PHP的十个高级技巧(下)_[PHP教程]
怎样在vb.net中将图片存入SQL,Server,2000并能读出来使用
开始了解,PHP,V5,中的对象_php资料_编程技术
两台Sql,server数据同步_[SQL,Server教程]
在ExcuteReader中使用输出参数的问题_[Asp.Net教程]
一个C#高级编程中的事件,DEMO,实例_.net资料_编程技术
Reading number is top 10 pictures
西班牙山村小景3
锄禾日了几个人?
再来随便发几张
Catch prostitution woman in China
The money of more than 100 countries and regions10
Valentine's day comes, send some cartoon
The money of more than 100 countries and regions9
The money of more than 100 countries and regions17
这只猪到底犯了什么错?
Azusa Yamamoto2
Download software ranking
网页特效实例大全
C#编程思想
Ashlynn Video5
中国结婚习俗实录
C#与.NET技术平台实战演练
Tram sex maniac 2 (H) rar bag16
WebService在.NET中的实战应用教学视频 → 第2集
The Bermuda triangle2
Unix video tutorial14
JSP+Ajax Web development typical examples
delv published in(发表于) 2014/1/24 9:08:56 Edit(编辑)
C#中生成中文繁体web页面_[Asp.Net教程]

C#中生成中文繁体web页面_[Asp.Net教程]

C#中生成中文繁体web页面_[Asp.Net教程]

1 在工程中引用Microsoft.VisualBasic.dll


一般此文件在.net框架环境目录中如C:\ WINNT \Microsoft.NET \Framework \v1.1.4322


\Microsoft.VisualBasic.dll。



2 使用方法


Microsoft.VisualBasic.Strings.StrConv( “instr”,Microsoft.VisualBasic.VbStrConv.TraditionalChinese, System.Globalization.CultureInfo.CurrentCulture.LCID);


* 该方法的使用可以在msdn中找到。


3 生成web页面使用编码 950,代码如下:


//写文件


public bool WriteFile( string contentStr,string filepath )


{


try


{


if ( filepath == null)


return false;


this.CreateDir( filepath.Substring( 0,filepath.LastIndexOf( "\\" ) ) );


StreamWriter outStream = new StreamWriter( filepath,false,System.Text.Encoding.GetEncoding( 950 ) );


outStream.Write( contentStr );


outStream.Close();


return true;


}


catch


{


return false;


}


}



4 读简体文件时使用编码 936


//读文件


public string ReadFile( string filepath )


{


string reStr = "";


if ( filepath ==null ) return reStr;


using ( StreamReader sr = new StreamReader( filepath,System.Text.Encoding.GetEncoding( 936 ) ) )


{


string line;


while( (line = sr.ReadLine())!=null )


{


reStr += line+"\r\n";


}


}


return reStr;


}


来源:http://blog.csdn.net/21aspnet







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.