摘要: 确定当前网站的物理文件路径在应用程序中,您可能需要确定服务器上的文件或其他资源的路径。例如,如果应用程序以编程方式对文本文件进行读写操作,则必须为用于读取和写入的方法提供该文件的完整物理路径。将物理文件路径(如 C:\Website\MyApplication)硬编码到应用程序中并不是很好的做法,因为如果移动或部署应用程序,则路径会发生更改。但是,ASP.NET 为您提供了以编程方式获取应用程序中的任何物理文件路径的方法。然后,您可以使用基文件路径创建所需资源的完整路径。用于确定文件路径的两种最常用的 ASP.NET 功能是返回路径信息的 HttpRequest 对象的属性,以及 MapPat 阅读全文
posted @ 2014-02-27 10:46 summer0311 阅读(927) 评论(0) 推荐(0) 编辑
摘要: $('#dg').datagrid({ url: "xxx.ashx", pagination: true, pageSize: 2, loadMsg:"正在努力加载数据,请稍后...", singleSelect:true, pageList: [2, 5, 10, 50], columns: [[ { field: 'UserName', title: '用户名', width: 100, sortable: true }, { field: 'UserId', title: ' 阅读全文
posted @ 2014-02-27 10:43 summer0311 阅读(13612) 评论(0) 推荐(1) 编辑
摘要: 控制台应用程序:Environment.CurrentDirectory、Directory.GetCurrentDirectory()windows服务:Environment.CurrentDirectorywindows服务安装成功后:1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName2.////// 获取服务应用程序的安装路径(或者当前安装目录)////// /// public static string GetWindowsServiceInstallPath(string ServiceNam 阅读全文
posted @ 2014-02-27 10:39 summer0311 阅读(2849) 评论(0) 推荐(0) 编辑