随笔分类 -  Asp.net

摘要:1.HTTP亦即Hpyer Text Transfer Protocal的缩写,它是现代互联网上最重要的一种网络协议,超文本传输协议位于TCP/IP协议的应用层,是一个面向 无连接、简单、快速的C/S结构的协议 。HTTP的工作过程大体上分连接、请求、响应和断开连接2..NET类库中提供了WebRequest和WebResponse就是利用这两个类实现的网络功能HttpWebRequest:HttpWebRequest 类对 WebRequest 中定义的属性和方法提供支持,也对使用户能够直接与使用 HTTP 的服务器交互的附加 属性和方法提供支持。 http://msdn.microsoft 阅读全文
posted @ 2011-12-04 22:15 sulin 阅读(327) 评论(0) 推荐(0)
摘要:1.SubstringSubstring(startIndex); startIndexType: System.Int32The zero-based starting character position of a substring in this instance. string str="ABCDEFG"; str.Substring(2); // returns "CDEFG" str.Substring(7);//returns an empty string str.Substring(8);//Causes an ArgumentOut 阅读全文
posted @ 2011-11-29 23:15 sulin 阅读(285) 评论(0) 推荐(0)
摘要:System.Web.HttpContext.Current.Request.ServerVariables获取1.没有使用代理服务器的情况: REMOTE_ADDR = 用户的 IP HTTP_VIA = 没数值或不显示 HTTP_X_FORWARDED_FOR = 没数值或不显示2使用透明代理服务器的情况:Transparent Proxies REMOTE_ADDR = 最后一个代理服务器 IP HTTP_VIA = 代理服务器 IP HTTP_X_FORWARDED_FOR = 用户的真实 IP3使用普通匿名代理服务器的情况:Anonymous Proxies REMOTE_ADDR. 阅读全文
posted @ 2011-11-27 23:40 sulin 阅读(244) 评论(0) 推荐(0)
摘要:1.引用这com组件 Mircosoft.Excel.12.0 Object Libary(自动添加应用Microsoft.Office.Interop.Excel)2.打开一个空excel 或者加载一个模板 private Excel.Application m_objExcel = null; private Excel.Workbooks m_objBooks = null; private Excel._Workbook m_objBook = null; private Excel.Sheets m_objSheets = null; private Excel._Worksheet 阅读全文
posted @ 2011-11-23 23:47 sulin 阅读(528) 评论(0) 推荐(0)
摘要:1.y代表年份 M表示月份 d表示日期 h或H表示小时,h用的是12小时制,H用的是24小时制 m表示分钟 s表示秒 Convert.ToDateTime("2011-11-20 19:05:34").ToString(format); format:'yyyy-MM-dd' 2011-11-20format:'MM-dd-yyyy' 11-20-2011format:'dd-MM-yyyy' 20-11-2011format:'yyyy-MM-dd hh:mm:ss' 2011-11-20 07:05:34f 阅读全文
posted @ 2011-11-22 19:06 sulin 阅读(217) 评论(0) 推荐(0)
摘要:1.C#连接连接Access 引用命名空间: System.Data System.Data.OleDb string connString="Provider=Microsoft.Jet.OleDb.4.0;Data Source=E:DB.mdb";2.C#连接SQL Server 引用命名空间:System.Data System.Data.SqlClient string connString="user id=sa;password=;initial catalog=Northwind;Server=.;Connect Timeout=30;" 阅读全文
posted @ 2011-11-14 23:13 sulin 阅读(354) 评论(0) 推荐(0)
摘要:1.sql存储过程 --创建存储过程示例create proc GetReturnValueOrOutputValue@Param_id nvarchar(12) outputasif(1>0)beginset @Param_id=1return 1end elsebeginset @Param_id=2return 2end2.C#程序调用//组合数据sqlparameter string sql_procedure=""; //执行sql存储过程 string constring = "";//配置文件的链接字符串 SqlCommand cmd 阅读全文
posted @ 2011-11-13 21:40 sulin 阅读(411) 评论(0) 推荐(0)