using System.IO;StreamReader sr = new StreamReader(Server.MapPath("yourtxt.txt"), System.Text.Encoding.GetEncoding("GB2312"));
string s = sr.ReadToEnd();
sr.Close();
string s = sr.ReadToEnd();
sr.Close();
解决方案 »
- (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- 请问asp.net开发的网站打开是不是比较慢啊
- 再问个菜鸟问题。。对不起。。侮辱大家的智慧啦。。
- 求助把C#中的web页面中的内容导出到word中时,图片不显示,样式也不对啊
- Excel 问题 !!!急救~~~~~~~!
- dropdownlist的问题 急等~~~~~~~~~~在线
- 小菜求助:ascx文件中的提交按钮功能失效了!
- 怎么改数据库名 用sql
- 请问用studio.net写asp.net的代码又可以兼顾界面美观?
- 怎样在代码后置文件中实现如下所述的问题:
- 我把datalist,RepeatColumns设置为3,每个纪录间距为100。可高度有问题了,间距太大了!!!
- 请问哪位知道如何通过代码将现有的.aspx及其.vb文件加入到项目中?
objFS = System.Web.HttpContext.Current.Server.CreateObject("scripting.filesystemobject")
objFile = objFS.opentextfile(strTempletPath, 1, False, 0)
Do While objFile.atendofstream <> True
strtemp = objFile.readline
strFileText = strFileText & strtemp
Loop
objFile.Close()
objFile = Nothing
objFS = Nothing