Asp.NET获取文件及其路径
【相对路径】
Request.ApplicationPath
/src
Path.GetDirectoryName(HttpContext.Current.Request.RawUrl )
\\src\\Xiaoshe
Context.Request.Path
/src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.CurrentExecutionFilePath
/src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.FilePath
/src/Xiaoshe/Xiaoshe_New.aspx
HttpContext.Current.Request.RawUrl
/src/Xiaoshe/Xiaoshe_New.aspx
HttpContext.Current.Request.Url
http://localhost:1344/src/Xiaoshe/Xiaoshe_New.aspx
TemplateSourceDirectory
/src/Controls
【绝对路径】
Server.MapPath("./")
E:\\Wonsoft\\Pro2\\src\\Xiaoshe\\
Server.MapPath("")
E:\\Wonsoft\\Pro2\\src\\Xiaoshe
Context.Request.PhysicalApplicationPath
E:\\Wonsoft\\Pro2\\src\\
Context.Request.PhysicalPath
E:\\Wonsoft\\Pro2\\src\\Xiaoshe\\Xiaoshe_New.aspx
MapPathSecure(TemplateSourceDirectory)
E:\\Wonsoft\\Pro2\\src\\Controls string
【其他】
Control.ResolveClientUrl(string relativeUrl)
Control.ResolveUrl(string relativeUrl)
相关文档:
//详细介绍asp.net获取日期时间的各种格式的函数
DateTime.Now.ToLocalTime().ToString(); // 2009-9-5 20:12:12
//获取日期
DateTime.Now.ToLongDateString().ToString(); // 2009年9月5日
......
一。①:首先要有这个文件URLRewriter.dll,如果没有,赶快到网上下载一个,并将其放到下面的bin目录里面,并且将其引用添加到下面里面;
②:下面就是Web.Config文件的配置了,当然,配置过程相当简单:
1:先添加这个
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.Rew ......
//压缩
protected void btnY_Click(object sender, EventArgs e)
{
string rar;
RegistryKey reg;
string args;
ProcessStartInfo procStart;
Process process;
try
{
reg = Registry.ClassesRoot.OpenSubKey(@"Applications\WinRAR.exe\Shell\Open\Command"); ......
DataGridView 控件DataGridView 控件提供用来显示数据的可自定义表。使用 DataGridView 类,可以自定义单元格、行、列和边框。
注意
DataGridView 控件提供 DataGrid 控件所不具备的许多基本和高级功能。有关更多信息,请参见 Windows 窗体 DataGridView 控件和
DataGrid 控件之间的区别
常用属性:
DefaultCellStyle、 ......