星空网 > 软件开发 > ASP.net

asp.net获取站点根目录下子目录的名称

使用Visual Studio建立一个.aspx文件(Web Forms),例如hovertree.aspx,在页面上加入一个ListBox
代码如下:

<asp:ListBox runat="server" ID="lbKeleyiFolder" />

 

那么在页面上显示根目录子文件夹的代码如下:

string[] m_subKeleyiFolder = Directory.GetDirectories(Server.MapPath("/hvtimg\\"));int m_countHovertree = m_subKeleyiFolder.Length;for (int i = 0; i < m_countHovertree; i++){m_subKeleyiFolder[i] = m_subKeleyiFolder[i].Substring(m_subKeleyiFolder[i].LastIndexOf("\\") + 1);}lbKeleyiFolder.DataSource = m_subKeleyiFolder;lbKeleyiFolder.DataBind();

 

HoverTree系统源码下载:http://hovertree.codeplex.com/

http://www.cnblogs.com/sosoft/p/kaifajishu.html




原标题:asp.net获取站点根目录下子目录的名称

关键词:ASP.NET

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流