Skip to main content

Posts

Showing posts from September, 2007

asp.net 1.1(C#)上传文件并直接读取

aspx部分: <form id="Form1" method="post" runat="server" enctype="multipart/form-data" > <INPUT type="file" id="fileContent" name="fileContent" enctyperunat="server" > <asp:Button id="btnUpload" runat="server" Text="Upload"></asp:Button> aspx.cs部分 using (StreamReader sr = new StreamReader(fileContent.PostedFile.InputStream)) {     while( sr.Peek() >= 0 )     {         sr.ReadLine();         //to do     } } 上面加代码的中红色加亮的部分是我觉得需要特别注意的地方。asp.net上传文件本来就是很简单,这次我遇到的情况是不能存储到服务器的硬盘上,需要直接对文件进行解析。 StreamReader 确是最佳的选择。

google reader trends

cnbeta果然是八卦大户啊

和谐

最进看了甑子丹主演的电影《导火线》和《杀破狼》,都是动作片,都讲到警察、黑帮、暴力。 最和谐的莫过于所有的事都发生在97以前,也对啊,回归后一切和谐,哪里还有黑帮的存在。

ConfigurationManager.AppSettings

在C# 2.0里面,如果使用ConfigurationSettings.AppSettings来获取<appSettings>节点里的值,可能会有 'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings' 的 警告 。但是,如果你添加 using System.Configuration; 并替换全部的ConfigurationSettings.AppSettings为ConfigurationManager.AppSettings却有 The name 'ConfigurationManager' does not exist in the current context 的 错误 。那是因为要想使用 System.Configuration 名称空间下的全部功能,你必须添加对System.Configuration.dll这个文件的引用,而默认的Windows Application项目模板中是没有引用这个文件的。

難道有無窮武盡的patch

后面的我不想贴了,考考

深受打击

注册,登录,等待体验我的我的新生活: 靠,280M的patch,3个小时才能完啊。。。 我等,我等等等

WOW TW

用了16个小时终于把魔兽世界下下来了: 先去注册个体验帐号玩着,点卡的事还真是麻烦阿。