易截截图软件、单文件、免安装、纯绿色、仅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中Server.MapPath的几种用法

 1.Server.MapPath("/") //应用程序根目录所在的位置 如 C:\Inetpub\wwwroot\
2.Server.MapPath("./") //表示所在页面的当前目录
//注:等价于Server.MapPath("") 返回 Server.MapPath("")所在页面的//物理文件路径
3.Server.MapPath("../")//表示上一级目录
4.Server.MapPath("~/../");//表示本文件所在文件夹所在的上一级目录
4.Server.MapPath("~/")//表示当前应用级程序的目录,如果是根目录,就//是根目录,如果是虚拟目录,就是虚拟目录所在的位置 如://C:\Inetpub\wwwroot\Example\
......

每天定时执行页面程序(asp.net)

首先建立一个c/s程序 在新建的form上加入一个浏览器控件和一个时间控件浏览器控件能转向你要执行的页面而时间控件控制多少时间后关闭你要执行的页面然后设置form的visible为false form的状态为最小化 目的是将整个执行的页面程序包在form的浏览器控件中执行而form会被隐藏 这样做神不知鬼不觉。最后用windows的计划任务每天定时执行编译生成的exe文件
注:form必须最小化和隐藏否则不能隐藏 ......

asp.net 调用存储过程

1.获取Return返回值
 程序代码//存储过程
//Create PROCEDURE MYSQL
//     @a int,
//     @b int
//AS
//     return @a + @b
//GO
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToString());
conn.Open();
SqlCommand MyCommand = new SqlCommand("MYSQL", conn);
MyCommand.CommandType = CommandType.StoredProcedure;
MyCommand.Parameters.Add(new SqlParameter("@a", SqlDbType.Int));
MyCommand.Parameters["@a"].Value = 10;
MyCommand.Parameters.Add(new SqlParameter("@b", SqlDbType.Int));
MyCommand.Parameters["@b"].Value = 20;
MyCommand.Parameters.Add(new SqlParameter("@return", SqlDbType.Int));
MyCommand.Parameters["@return"].Direction = ParameterDirection.ReturnValue;
MyCommand.ExecuteNonQuery();
Response.Write(MyCommand.Parameters["@return"].Value.ToString());
2.获取Output输出参数值
 程序代码//存储过程
//Create PROCEDURE MYSQL
//     @a int,
......

ASP.NET操作Cookie

//创建
HttpCookie cookie = new HttpCookie("user","111");//创建Cookie
cookie Expires = DateTime.Now.Add(15);//设置过期时间
 Response.Cookies.Add(cookie);//存入客户端
我们取出Cookie值也很简单
string value = Request.Cookies["user"].value;
有时候我们想在一个Cookie中储存多个信息,那也没有问题。比如我们在名为user的cookie下加多个信息
HttpCookie cookie = new HttpCookie("user");
cookie.Values.Add("name","222");
cookie.Values.Add("pwd","333");
cookie.Values.Add("member","admin");
Response.Cookies.Add(cookie);
从客户端获取取信息也一样简单
HttpCookie cookie = Request.Cookies["user"];
value1 = cookies.Values["name"];
value2 = cookies.Values["pwd"]; ......

ASP.NET MVC 简介

这个是在网上找的一个关于ASP.NET MVC 的定义,我觉得已经解释的够好了,所以就借过来用用了 ,呵呵
希望有心学习ASP.NET MVC 的朋友先熟悉定义,在后续的文章中会更轻松的学习ASP.NET MVC
下面我们一起踏上ASP.NET MVC 之旅吧,只要有恒心和毅力,祝学者们旅途愉快!
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace.
MVC is a standard design pattern that many developers are familiar with. Some types of Web applications will b ......

ASP.NET中bin app_code app_data等文件夹的作用

 转贴自  http://wuxiong8665.blog.163.com/blog/static/93512200991811400157/
概览:
 文件夹名称
   文件类型
   注        释
 Bin
  .dll
    包含应用程序所需的任何预生成的程序集
 App_Browsers
   .browser
   包含应用程序特有的浏览器定义文件,ASP.NET用它来识别各浏览器及确定它们的功能
 App_Code
   .cs、.vb、.xsd、自定义的文件类型
   包含作为应用程序的一部分编译的类的源文件。当页面被请求时,ASP.NET编译该文件夹中的代码。该文件夹中的代码在应用程序中自动地被引用
 App_Data
   .mdb、.mdf、.xml
  包含Microsoft  Office  Access和SQL  Express文件以及XML文件或其他数据存储
 App_GlobalResources
   .resx
   包含在本地化应用程序中以编程方式使用的资源文件
 App_LocalResources
   .resx
   包含页面范围的资源文件
 App_Themes
   .skin、.CSS、.xsl、 ......
总记录数:2672; 总页数:446; 每页6 条; 首页 上一页 [376] [377] [378] [379] 380 [381] [382] [383] [384] [385]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号