从Web服务器创建文件夹到远程存储 [英] Create folder from a web server to remote storage

查看:89
本文介绍了从Web服务器创建文件夹到远程存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。



我正在开发一个vb.net应用程序,它假设在远程存储区域创建一个文件夹。



我尝试了什么:



我尝试过以下方法:

1)我使用Directory.CreateDirectory(root)指向我的c:apps工作正常。

2)当我将它指向远程存储本身时,它不起作用。

Dim root As String =\\xxxx.xxx.xxxx.xx\Geo \Proj\Development\

它说,访问路径xxx被拒绝。

3)在我的网络服务器中创建目录。

4)当我创建虚拟目录时,物理路径是远程存储路径...仍然表示访问被拒绝。



请帮助我,因为我的日期线是2016年11月26日星期六。



以下是我在创建目录时使用的代码:









Dim root as string = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings(AppDoc_Path)



如果不是目录.Exists(root)然后

'File.Create(root)

Directory.CreateDirectory(root)

SessionUtility.MessageBox(不存在,Page)



Else



at m y web.config我已声明:

< add key =AppDoc_Pathvalue =〜/ Document>





文件是我想创建目录的文件夹



如果需要进一步澄清,请告诉我。

Hi.

I am developing a vb.net application where it suppose to create a folder at a remote storage area.

What I have tried:

I have tried the following:
1) i used the Directory.CreateDirectory(root) pointing it to my c:apps is working fine.
2) when i point it to the remote storage itself, it doesn't work.
Dim root As String = "\\xxxx.xxx.xxxx.xx\Geo\Proj\Development\"
it says, access to the path xxx is denied.
3) creating the directory in my web server it works.
4) when i create the virtual directory and physical path is the remote storage path...Still it says access is denied.

Please help me in this as my dateline is this saturday 26th Nov 2016.

Below is the code that i have used in creating the directory:




Dim root as string = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings("AppDoc_Path")

If Not Directory.Exists(root) Then
'File.Create(root)
Directory.CreateDirectory(root)
SessionUtility.MessageBox("Not exist", Page)

Else

At my web.config i have declared this:
<add key="AppDoc_Path" value="~/Document">


Document is the folder where i suppose to create the directory

Please let me know if further clarification is required.

推荐答案

引用:

2)当我将它指向远程存储本身时,它不会工作。

Dim root As String =\\xxxx.xxx.xxxx.xx\Geo \Proj\Development\

它说,访问路径xxx被拒绝。

2) when i point it to the remote storage itself, it doesn't work.
Dim root As String = "\\xxxx.xxx.xxxx.xx\Geo\Proj\Development\"
it says, access to the path xxx is denied.

简单:这意味着您的应用程序在没有远程计算机凭据的会话中运行。

应用程序会话需要使用足够的凭据登录到远程计算机以执行您想要的操作。

Simple: it means that your app runs in a session that don't have credentials to the remote computer.
The app session need to log to remote computer with enough credentials to do what you want.


这篇关于从Web服务器创建文件夹到远程存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆