
WebForm
acewang
这个作者很懒,什么都没留下…
展开
-
一个关于IIS的类
Imports System Imports System.DirectoryServices Imports System.IO Public Class IISManager Public Shared Function CreateWebSite(ByVal webSiteName As String, ByVal pathToRoot As String) As WebSite原创 2004-02-13 11:28:00 · 990 阅读 · 0 评论 -
在UserControl中调用所在页面的ViewState
这样实现:Page mypage = (Page)System.Web.HttpContext.Current.Handler; string s = (string) mypage.ViewState["Whatever"];原创 2004-08-02 09:50:00 · 942 阅读 · 0 评论 -
在域控制器中使用默认ASPNET 帐户时ASP.NET 不能正常运行
在域控制器或备份域控制器上安装Microsoft Visual Studio .NET 或Microsoft .NET 框架后,如果您尝试运行 ASP.NET 应用程序,则浏览器会显示下面的错误信息: Server Application Unavailable The web application you are attempting to access on this web server原创 2004-08-02 09:56:00 · 1736 阅读 · 0 评论 -
操作Word的权限问题
//先杀掉你击进程中的word.exe 1.在web.config里面 .....................加入 或 开始->运行->"dcomcnfg"->在应用程序列表框中选择“Microsoft Excel 应用程序”-> “安全性”->选择“使用自定义访问权限”,点击“编辑”按钮添加本地“ASPNET”用户,权限为“允许访问原创 2004-08-02 10:13:00 · 4207 阅读 · 0 评论 -
关于后台生成的模板列的数据绑定问题
动态产生模版列参考:public class DataGridTemplate : ITemplate{?? ListItemType templateType;?? string columnName;?? ?? public DataGridTemplate(ListItemType type, string colname)?? {????? templateType = type;????原创 2004-07-29 12:21:00 · 1072 阅读 · 0 评论 -
在aspx发送前记录下生成的html
重写Render:StringBuilder sbPage = new StringBuilder();TextWriter tw = (TextWriter) new StringWriter(sbPage);System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);base.Render(hw);string原创 2004-07-29 12:45:00 · 1437 阅读 · 0 评论 -
访问远程access数据库总弹出的对话框
---比如有a、b两台机子,在a机上有access数据库,共享在//a//exam//水位.mdb 。 现在在b机编写程序访问之。conn = new OleDbConnection();conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=//a//exam//水位.mdb ";conn.Open();---原创 2004-07-29 12:46:00 · 1309 阅读 · 0 评论 -
无法在web服务器上启动调试
原因可能是在域控制器上安装的.NET,ASPNET账号(启动aspnet_wp.exe账号)没有足够的创建进程的权限所致。 请尝试如下几种方法: 方法1: 将账号ASPNET加入本机管理员中。 方法2: 进入/WINNT/Microsoft.NET/Framework/Version/Config目录,打开machine.config文件。找到processModel项,将其中usern原创 2004-08-02 10:01:00 · 3209 阅读 · 2 评论 -
鼠标移动时行变色并可以点击行时选中行
//第一列需要放置一个LinkButton列用来选中行private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if(e.Item.ItemType==ListItemType.原创 2004-08-02 10:10:00 · 1307 阅读 · 0 评论 -
使用HttpRequest向某网页发送Post请求
private void OnPostInfoClick(object sender, System.EventArgs e){ string strId = UserId_TextBox.Text; string strName = Name_TextBox.Text; ASCIIEncoding encoding=new ASCIIEncoding(); string postData="us原创 2004-08-10 17:29:00 · 3577 阅读 · 0 评论 -
将DataView转化成DataTable
public static DataTable GetDataTable(DataView obDataView){ if (null == obDataView) { throw new ArgumentNullException ("DataView", "Invalid DataView object specified"); } DataTable obNewDt = obDataView原创 2004-08-02 13:42:00 · 2472 阅读 · 0 评论 -
ASP.net如何访问域用户信息
//没AD也没关系,不用LDAP,用WinNT服务也可以的 using System.DirectoryServices; DirectoryEntry objDE; objDE=new DirectoryEntry("WinNT://servername","username","password",System.DirectoryServices.AuthenticationTyp原创 2004-08-02 10:00:00 · 1565 阅读 · 0 评论 -
动态改变DataList绑定的字段值
论坛问题http://community.youkuaiyun.com/Expert/topic/3217/3217350.xml?temp=.2064478在DataList中默认绑定的字段是 实现: public string Check(DataRowView container){ //判断条件 //return container[ColumnIndex] or container["colu原创 2004-07-29 12:23:00 · 2073 阅读 · 0 评论 -
网页传递的参数为乱码或不全
修改你的Web.Config:...原创 2004-07-29 12:52:00 · 1036 阅读 · 0 评论 -
Asp.net中基于Forms验证的角色验证授权
http://dev.youkuaiyun.com/develop/article/18/18958.shtmhttp://support.microsoft.com/default.aspx?kbid=306590&product=aspnethttp://www.codeproject.com/aspnet/formsroleauth.asp原创 2004-07-29 18:04:00 · 907 阅读 · 0 评论 -
ASP.NET服务器端异步Web方法
ASP.NET服务器端异步Web方法http://www.microsoft.com/china/msdn/archives/library/dnservice/html/service10012002.asp原创 2004-07-29 18:07:00 · 845 阅读 · 0 评论 -
文件下载时出现提示框不直接打开
//读取文件输出它 string strFile = "c://abc.doc"; FileStream fs = new FileStream(strFile, FileMode.Open); byte[] bytes = new byte[(int)fs.Length]; fs.Read(bytes, 0, bytes.Length); fs.Close(); Response.Content原创 2004-08-02 09:48:00 · 2146 阅读 · 0 评论 -
请问在C/S系统中如何设置配置文件
System.Configuration.ConfigurationSettings.GetConfig("ApplicationConfiguration");orRuntime Web.config / App.config Editing http://www.eggheadcafe.com/articles/20030907.asp-----------------------------原创 2004-07-29 12:35:00 · 1156 阅读 · 0 评论 -
Nested DataGrid/DataList
网上到处都是这种例子http://www.aspnet101.com/aspnet101/aspnet/codesample.aspx?code=nesthttp://msdn.microsoft.com/msdnmag/issues/03/10/CuttingEdge/default.aspx原创 2004-07-29 12:39:00 · 768 阅读 · 0 评论 -
aspnet中获得图片的大小
System.Drawing.Image imgPhoto = System.Drawing.Image.FromFile(Server.MapPath(yourFile)); int sourceWidth = imgPhoto.Width; int sourceHeight = imgPhoto.Height;原创 2004-07-29 18:08:00 · 1095 阅读 · 0 评论 -
在asp.net中计算叶面执行所耗时间
language="C#" runat=server> DateTime startTime; void Page_Init (Object sender, EventArgs e) { startTime = DateTime.Now; //Response.Write("page init"); } protected override原创 2004-08-02 09:54:00 · 994 阅读 · 1 评论 -
无法创建Web项目"WebApplication1
1. Launch the Internet Information Services MMC. 2. Right click on your web site and click properties. 3. In the HTTP Headers tab click MIME Types... button. 4. Add a new MIME type by clicking Ne原创 2004-08-02 09:59:00 · 1681 阅读 · 0 评论 -
在ASP.NET中动态包含文件
原理是使用Response.WriteFile()例如: Response.WriteFile ("Yourfile.inc"); %>原创 2004-08-10 17:19:00 · 1510 阅读 · 0 评论