02 2010 档案
摘要:1. 进入 GDB 并读入可执行档 (档名为 'PROGRAM'),准备进行除错。 gdb PROGRAM 指定程序代码所在目录及检视程序代码 1. 增加目录 DIR 到收寻程序代码的目录列表 (如果你的程序代码和可执行档放在同一个目录下,就不须指定程序代码所在目录。): (gdb) directory DIR 2. 检视程序代码,格式计有: (gdb) list => 显示目前...
阅读全文
摘要:单引号更严格一些。它可以防止任何变量扩展。双引号可以防止通配符扩展但允许变量扩展。 #!/bin/sh echo $SHELL echo "$SHELL" echo '$SHELL' 运行结果为: /bin/bash /bin/bash $SHELL
阅读全文
摘要:loop loop表达式: while ...; do .... done while-loop 将运行直到表达式测试为真。will run while the expression that we test for is true. 关键字"break" 用来跳出循环。而关键字”continue”用来不执行余下的部分而直接跳到下一个循环。 for-loop表达式查...
阅读全文
摘要:select select 表达式是一种bash的扩展应用,尤其擅长于交互式使用。用户可以从一组不同的值中进行选择。 select var in ... ; do break done .... now $var can be used .... 下面是一个例子: #!/bin/sh echo "What is your favourite OS?" select var in "Linux" ...
阅读全文
摘要:case case :表达式可以用来匹配一个给定的字符串,而不是数字。 case ... in ...) do something here ;; esac 让我们看一个例子。 file命令可以辨别出一个给定文件的文件类型,比如: file lf.gz 这将返回: lf.gz: gzip compressed data, deflated, original filename, last ...
阅读全文
摘要:程序必须以下面的行开始(必须方在文件的第一行): #!/bin/sh 符号#!用来告诉系统它后面的参数是用来执行该文件的程序。在这个例子中我们使用/bin/sh来执行程序。 当编辑好脚本时,如果要执行该脚本,还必须使其可执行。 要使脚本可执行:编译 chmod +x filename 这样才能用./filename 来运行
阅读全文
摘要:Shell里的流程控制if 语句“if”表达式如果条件为真,则执行then后的部分:if ….; then….elif ….; then….else….fi大多数情况下,可以使用测试命令来对条件进行测试,比如可以比较字符串、判断文件是否存在及是否可读等等……通常用”...
阅读全文
摘要:负载均衡一般设三个地方来保证进程延续。首先启动负载均衡,然后设置“Enable Connection Rebind”为true.最后Persistence Type一般设为Simple再加上超时时间。
阅读全文
摘要:public可以被任意存取; protected只可以被本类和其继承子类存取; internal只可以被本组合体(Assembly)内所有的类存取,组合体是C#语言中类被组合后的逻辑单位和物理单位,其编译后的文件扩展名往往是“.DLL”或“.EXE”。 protected internal唯一的一种组合限制修饰符,它只可以被本组合体内所有的类和这些类...
阅读全文
摘要:usingSystem.Web.SessionStateHttpSessionState ss = HttpContext.Current.Session;HttpContext.Current.Session["test"] = "test";TextBox1.Text = ss.SessionID;
阅读全文
摘要:If you deploy your application in a Web farm, you must ensure that the configuration files on each server share the same value for validationKey and decryptionKey<machineKey validationKey="21F09093...
阅读全文
摘要:PersonSession person = new PersonSession(int.Parse(txtPersonId.Text), txtName.Text, int.Parse (txtAge.Text),chkEmailValidated.Checked);PersonSession.CreatePersonSession(person);----------------------...
阅读全文
摘要:Session data is lost when the visitor leaves the webpage.ASP.NET Profile provides a neat way to persist information for a long time.<profile> <properties> <add name="Id" type="Int32"/&g...
阅读全文
摘要:protected void Page_Load(object sender, EventArgs e) { if (Session["name"] != null) Response.Write(Session["name"]); } protected void btnCreateSession_Click(object sender, EventArgs e) { Session["name...
阅读全文
摘要:Session id的存储方式有以下四种1、AutoDetect Web.config做相应的配置如下:<system.web> <sessionState cookieless="AutoDetect"> </sessionState></system.web>ASP.NET 确定请求浏览器或请求设备是否支持 Cookie。如果请求浏览器或请求设备...
阅读全文
摘要:string queryStringValue = Request.QueryString["key"]; if (string.IsNullOrEmpty(queryStringValue)) { // querystring not supplied. Do necessary action } else // Querystring supplied. continue execution
阅读全文
摘要:// encoding querystring string id = "1"; string name = "foo#"; string url = string.Format("foo.aspx?{0}&{1}", Server.UrlEncode(id), Server.UrlEncode(name)); Response.Redirect(url); // decoding can...
阅读全文
摘要://retrieve cookies by cookies nameHttpCookie _userInfoCookies = Request.Cookies["UserInfo"];string userName;//Check cookiesif (_userInfoCookies != null){ userName = _userInfoCookies["UserName"];}
阅读全文
摘要:Application object is used to store data which is visible across entire application and shared across multiple user sessions. For example:Application.Lock();Application["mydata"]="mydata";Application....
阅读全文
摘要:Query strings are usually used to send information from one page to another page.Example The following string might be sent:http://www.aspx?name=John&age=30 this results in the following QUERY_STR...
阅读全文
摘要:Hidden fields are used to store data at the page levelprotected System.Web.UI.HtmlControls.HtmlInputHidden Hidden1;//to assign a value to Hidden fieldHidden1.Value="Create hidden fields";//to retrieve...
阅读全文
摘要:SessionID always change, on page reload / postback, next page in .NET 2.0 even for same user.However, if someone actives the session, then the SessionID will keep same the that one.for example: Button...
阅读全文
摘要:protected void Button1_Click(object sender, EventArgs e) { //Store Student Class in View State student _objStudent = new student(); _objStudent.AddStudent(int.Parse(TextBox1.Text.ToString()), TextBox...
阅读全文
摘要:进入C:\Documents and Settings\Administrator运行dir/ah 显示隐藏的文件夹和文件 或dir/ad 显示所有文件夹包括隐藏的文件夹就可发现Cookies文件夹
阅读全文
摘要://Creting a Cookie Object HttpCookie _userInfoCookies = new HttpCookie("UserInfo"); //Setting values inside it _userInfoCookies["UserName"] = "Abhijit"; _userInfoCookies["UserColor"] = "Red"; _userInf...
阅读全文
摘要:class App { static void Main(string[] argv) { int len = 12; if (argv.Length > 0) len = int.Parse(argv[0]); byte[] buff = new byte[len / 2]; RNGCryptoServiceProvider rng = new RNGCryptoServiceProvid...
阅读全文
摘要:Configuration for SQL Server Session Modeadd <sessionState mode="SQLServer" sqlConnectionString="data source=.; user id=sa;password=sa"/>In SQL Server Session mode, we are storing session data i...
阅读全文
摘要:New class in Asp.net locates in App_code folder, if not, the new class will be not visable in the website
阅读全文
摘要:IsPostBack所指一般为第二次及其以后的访问!IsPostBack才为首次访问 一个页面第一次显示的时候 IsPostBack=false 然后你在这个页面上点击按钮或其它东西如刷新提交的时候, IsPostBack=true
阅读全文