08 2012 档案
摘要:案例:有一个ASP.NET的项目,对整个项目访问限制,不允许匿名用户访问,登录页面除外。1.web.config配置文件代码如下:<!--配置Forms身份认证 不允许匿名用户访问,否则跳转到/.../login.aspx 页面 --><authentication mode="Forms"><forms name="myTeacher" loginUrl="~/.../login.aspx" protection="All" path="/" timeout=&q
阅读全文
摘要:使用一个按钮就可查找出文件,是不是很方便,这样就快速帮我们找到它的具体位置protected void Button1_Click(object sender, EventArgs e) { string path = ""; string physicsPath = Server.MapPath(Request.ApplicationPath); //将当前虚拟根路径转为实际物理路径 string toFindDirectoryName = "ss"; //要查找的文件夹名 FindDirectory(physicsPath + ...
阅读全文
摘要:///建CheckCode.aspx///在用的地方 <asp:Image ID="Image1" runat="server" Height="27px" Width="77px" imageurl="CheckCode.aspx"/>using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using S
阅读全文
摘要:1.先写个类CheckCode.cs代码如下:using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Drawing;/// <summary>/// CheckC
阅读全文
摘要:/// <summary> /// 生成验证码图片 /// </summary> /// <param name="checkCode"></param> /// <param name="response"></param> public static void CreateCheckCodeImage(string checkCode, System.Web.HttpResponse response) { int width = 80;//验证码图片宽度 int height
阅读全文
摘要:从net里面获得一个文件夹里所有文件的方法using System; /// <summary> /// 文件操作类 /// </summary>public class FileObj : IDisposable{ private bool _alreadyDispose = false; #region 构造函数 public FileObj() { // // TODO: 在此处添加构造函数逻辑 // } ~FileObj() { Dispose(); ; } ...
阅读全文
摘要:一个网站最重要的是快速读出大量的信息,然而有时,这些文件是以别的形式存在,所以就会大量加重人的负担。但是在 .NET中有方便的向浏览器输出文本文件response.charset="gb2312" '指定页面的编码方式为中文gb2312response.writefile("example.txt") '文件的名字也可以读取文件,将文件在页面显示。<table><tr><tdstyle="width: 100px"><%Response.WriteFile("HTML
阅读全文
摘要:博客园,是一个同事介绍给我的。我之前有很多关于技术上的用户地址,像是CSND,enet等。但是,由于同事的介绍,我还是对这个充满好奇。本人刚刚毕业,踏入社会不久,所以对这个行业充满了个人的期待。希望有志同道合的人,一起进行讨论。
阅读全文