如题,不知道有没有人遇到这样的问题
解决方案 »
- Repeater控制显示4个
- 如何方便的截取html文本
- Attributes.Add怎么设置字体颜色
- 怎样返回数据库的视图名称,包括更新的视图
- 如何将datagrid的editcommandcolumn的visible属性设为true?
- 怎么样有ListBox中显示成树型数据????????????
- 编写了一个数据库层组件,使用Nunit测试完成,在Web页中使用却无效
- SmartNavigation设为true 这个是什么意思啊?
- 寻求.net平台下的高效的邮件群发解决方法!!!
- 请大家帮帮忙
- 这段代码中的 <%# 是什么意思?
- asp.net PasswordRecovery控件问题 愁死了!!!!!!
这样看看行不行
string nowfilepath= Request.PhysicalPath;
FileInfo filepath = new FileInfo(nowfilepath);
int depth = 0;
DirectoryInfo dir=filepath.Directory;
while (dir.FullName != rootpath)
{
depth++;
dir = dir.Parent;
}
Response.Write(depth.ToString());
string imagepath = "image/1.gif ";
for (int i = 0; i < depth; i++)
{
imagepath = "../" + imagepath;
}
protected string URL
{
get
{
return url.Replace("~","../..");
}
}前台:
<a href="<%=URL%>"><asp:Image ID="Image1" runat="server" /> </a>