易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : asp.net

关于ASP.NET/C#中对Cookie的操作

写cookie
  1 HttpCookie cookie = new HttpCookie("Info");//定义cookie对象以及名为Info的项
  2 DateTime dt = DateTime.Now;//定义时间对象
  3 TimeSpan ts=new TimeSpan(1,0,0,0);//cookie有效作用时间,具体查msdn
  4 cookie.Expires = dt.Add(ts);//添加作用时间
  5 cookie.Values.Add("user","cxbkkk");//增加属性
  6 cookie.Values.Add("userid","1203");
  7 Response.AppendCookie(cookie);//确定写入cookie中
  读取cookie
  1 if(Request.Cookies["Info"]!=null)
  2 {
  3     string temp=Convert.ToString(Request.Cookies["Info"].Values["user"])+" "+Convert.ToString(Request.Cookies["Info"].Values["userid"]);
  4     //读全部就用Request.Cookies["Info"].Value)
  5     if(temp=="")
  6     {
  7         Response.Write("空");
  8     }
  9     else
  10         ......

关于ASP.NET/C#中对Cookie的操作

写cookie
  1 HttpCookie cookie = new HttpCookie("Info");//定义cookie对象以及名为Info的项
  2 DateTime dt = DateTime.Now;//定义时间对象
  3 TimeSpan ts=new TimeSpan(1,0,0,0);//cookie有效作用时间,具体查msdn
  4 cookie.Expires = dt.Add(ts);//添加作用时间
  5 cookie.Values.Add("user","cxbkkk");//增加属性
  6 cookie.Values.Add("userid","1203");
  7 Response.AppendCookie(cookie);//确定写入cookie中
  读取cookie
  1 if(Request.Cookies["Info"]!=null)
  2 {
  3     string temp=Convert.ToString(Request.Cookies["Info"].Values["user"])+" "+Convert.ToString(Request.Cookies["Info"].Values["userid"]);
  4     //读全部就用Request.Cookies["Info"].Value)
  5     if(temp=="")
  6     {
  7         Response.Write("空");
  8     }
  9     else
  10         ......

Parameter Queries in ASP.NET with MS Access

Parameter Queries in ASP.NET with MS Access
A selection of code samples for executing queries against MS Access using parameters.
Making use of the ASP.NET 2.0 datasource controls is fine, but it is important to understand how to manually create data access code. Best practice dictates that, at the very least, parameters are used to represent values that are passed into the SQL to be executed, rather than un-sanitised values straight from the user. The main reason for this cannot be over-emphasised in terms of its importance - it protects the application against SQL Injection attacks. In addition, parameters do not require delimiters. Therefore there is no need to worry about octothorpes (#) or apostrophes for dates, or doubling single quotes in strings.
These samples all assume that the values being passed into the parameters have been properly validated for datatype, existence, range etc, according to the business rules for the application. The serverside validation code is not i ......

Paging long articles in ASP.NET using C#

Paging long articles in ASP.NET using C#
Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that gets posted to a database.
The Regular Expression Split() method returns a one-dimensional zero-based array containing a number of substrings, so it is perfect for this job. What I want to do is take an article (which is a string) and divide it into substrings. In order to do this, I need a delimiter, and I use <!--pagebreak-->. As I enter the article into the database, I place <!--pagebreak--> at the points I want to break the article.
Then, having extracted the article from the database, I pass it to the following static method which I have in a utility class:
public static string PageArticle(string Article)
{
string Output;
string ThisPage = HttpContext.Current.Requ ......

Paging long articles in ASP.NET using C#

Paging long articles in ASP.NET using C#
Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that gets posted to a database.
The Regular Expression Split() method returns a one-dimensional zero-based array containing a number of substrings, so it is perfect for this job. What I want to do is take an article (which is a string) and divide it into substrings. In order to do this, I need a delimiter, and I use <!--pagebreak-->. As I enter the article into the database, I place <!--pagebreak--> at the points I want to break the article.
Then, having extracted the article from the database, I pass it to the following static method which I have in a utility class:
public static string PageArticle(string Article)
{
string Output;
string ThisPage = HttpContext.Current.Requ ......

[ASP.NET]后台枚举空间

在后台用C#枚举控件不像javascript那么简单,HasControls只能抓到直属下级的控件,如果有多个div,table嵌套,就要递归了
 public static void CloseAllContent(System.Web.UI.Control page,bool bOpen)
    {
        int nPageControls = page.Controls.Count;
        for (int i = 0; i < nPageControls; i++)
        {
             foreach (System.Web.UI.Control control in page.Controls[i].Controls)
             {
                if (control.HasControls())
                {
                     CloseAllCon ......

ASP.NET FCKeditor 文本编辑器的使用

ASP.NET FCKeditor 文本编辑器的使用 【转】
下载地址:http://www.fckeditor.net/download

FCKeditor使用
一、配置
1、在www.fckeditor.net
点击Download,下载FCKEditor_2.5.1.zip和FCKEditor.Net(ASP.NET
Control to easily integrate FCKEditor on .Net Web pages.)
2、新建一项目,比如叫FCK。解压FCKEditor_2.5.1.zip,里面有个fckeditor目录。把该目录整个复制到新建的ASP.NET项目根目录下。打开fckeditor目录下的fckconfig.js,修改二项:
FCKConfig.DefaultLanguage = 'en' ;
改为
FCKConfig.DefaultLanguage =
'zh-cn' ;
-----------------------------------------------------
var
_FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php
| py
改为
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso
| perl | php | py
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm |
lasso | perl | php | py
3、在vs05/08的工具箱上新建一个名叫FCKEditor的Tab,然后在里面点右键,选择Choos ......

ASP.NET自定义错误页面

ASP.NET 提供三种用于在出现错误时捕获和响应错误的主要方法:Page_Error 事件、Application_Error 事件以及应用程序配置文件 (Web.config)。
如果您不调用 Server.ClearError 或者捕获 Page_Error 或 Application_Error 事件中的错误,则将根据 Web.config 文件的 <customErrors> 部分中的设置处理错误。在 <customErrors> 部分,可将重定向页指定为默认的错误页 (defaultRedirect) 或者根据引发的 HTTP 错误代码指定特定页。您可使用此方法自定义用户收到的错误信息。
尽管您可在 <customErrors> 部分中 defaultRedirect 属性的值中引用默认的错误页,但是您还可根据引发的 HTTP 错误代码指定要重定向到的特定页。<error> 子元素允许使用此选项
<customErrors mode="On" defaultRedirect="ApplicationErroy.aspx">
    <error statusCode="403" redirect="403.htm"/>
    <error statusCode="404" redirect="404.htm"/>
    <error statusCode="500" redirect="500.htm"/>
</customErrors>
asp.net自定义错误处理页面方法一
1、添加Web.config, < system ......
总记录数:2672; 总页数:446; 每页6 条; 首页 上一页 [154] [155] [156] [157] 158 [159] [160] [161] [162] [163]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号