简体   繁体   English

如何在共享点Web应用程序的虚拟目录中获取子目录?

[英]How to get the subdirectory in virtual directory of a sharepoint web application?

I have a subdirectory called "Holidays" in my sharepoint virtual directory. 我的共享点虚拟目录中有一个名为“假日”的子目录。 "Holidays" ahs other subdirectories like "2010,"2011,"2012" I am trying to read the files under the subdirectory of holiday and display the lists of all the files. “假日”还有其他子目录,例如“ 2010”,“ 2011”,“ 2012”,我正在尝试阅读holiday子目录下的文件,并显示所有文件的列表。

I am not able to get a map to the virtual directory so far. 到目前为止,我还无法获得到虚拟目录的映射。 How can i get a physical path map so that i can treat the path as a directory and write retrieve all the files than end with .html and display. 我如何获取物理路径映射,以便可以将路径视为目录并写入以.html结尾并显示的方式检索所有文件。

so far i have tried this 到目前为止,我已经尝试过

SPWebApplication _webapp = SPContext.Current.Site.WebApplication;
ltr_test.Text = _webapp.IisSettings[SPUrlZone.Default].Path.ToString();

it gives me an output like this 它给我这样的输出

C:\inetpub\wwwroot\wss\VirtualDirectories\mywebsite.com

what i am looking for is this 我正在寻找的是这个

C:\inetpub\wwwroot\wss\VirtualDirectories   

what changes i have to make any help 我必须做出什么改变才能有所帮助

Well , then you can put it as a parameter in Path.GetDirectoryName() method? 好了 ,那么您可以将其作为Path.GetDirectoryName()方法中的参数了吗?

Path.GetDirectoryName(@"C:\inetpub\wwwroot\wss\VirtualDirectories\mywebsite.com")

should return 应该回来

C:\inetpub\wwwroot\wss\VirtualDirectories 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在没有虚拟目录的情况下部署.NET Web应用程序 - How to deploy .NET web application without virtual directory 如果共享点文档库中不存在目录和子目录,如何创建 - How to create directory and subdirectory if it does not exist in sharepoint Document Library 如何在Web应用程序的子目录中初始化某些类 - How to initialize some classes in a subdirectory in web application 如何将应用程序标记为Web应用程序? (与虚拟目录相对。) - How do I mark an application as a web application? (As opposed to a virtual directory.) 向 web 应用程序添加通用内容虚拟目录时如何做安全权限? - How do you do security permissions when adding a common content virtual directory to a web application? 如何正确链接已安装的Web应用程序名称及其虚拟目录名称? - How to correctly link the installed web application name and its virtual directory name? 如何在应用程序中提供虚拟目录路径 - How to give virtual directory path in application 以编程方式为网站创建虚拟目录-Web应用程序 - create a virtual directory for a website programmatically- web application 如何在Application_Start期间获取Web目录? - How do I get the Web Directory during Application_Start? 虚拟目录和Web服务 - Virtual Directory and Web Services
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM