サーバーAにWebサイトがあり、サーバーBでディレクトリを見つける必要があります。
私のaspxページには、次のものがあります。
<mb:FileSystemDataSource
ID="fileSystemDataSource" runat="server"
RootPath="\\servername\Folder\Subfolder"
FoldersOnly="true" />
mbはアセンブリ名のエイリアスです。
私のaspx.csページには、次のものがあります。
protected void Page_Load(object sender, EventArgs e)
{
DataTable gridviewSource = DisplayFilesInGridView();
DataRow gridviewRow;
//sets the server path so it does not default to current server
string ServerPath = System.IO.Path.Combine(
"//",
this.fileSystemDataSource.RootPath);
//Get All Folders Or Directories and add in table
DirectoryInfo directory = new DirectoryInfo(Server.MapPath(ServerPath));
DirectoryInfo[] subDirectories = directory.GetDirectories();
}
サーバーが見つからないため、Server.MapPathでエラーがスローされます。ネットワークに接続しています。IISを調べましたが、それは問題ではないと確信しています。もしそうなら、私は本当に詳細が必要になります。どんな助けでもいただければ幸いです。