iis中托管的WF服务访问网络共享文件夹 [英] Wf service hosted in iis access to a network shared folder

查看:165
本文介绍了iis中托管的WF服务访问网络共享文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我在iis中托管了wf服务,我的一项自定义活动需要将一些文件复制到共享文件夹中,例如 \\ computername \ sharedfolder ,此文件夹包含一些权限,用户名和密码.

I have a wf service hosted in iis and one of my custom activities needs to copy some files to a shared folder like \\computername\sharedfolder and this folder nedds some permisions, a username and a password.

我如何访问提供密码功能的那个文件夹中的文件.

How can i get access to the files in that folder providing the autentication.

谢谢

推荐答案

您好,尝试了以下几种方法:

Hi tried the flowing ways:

string caminho =  @"\\mypc\sharedfolder\";
string caminhoPastaFichTemp = "c:\\";
string nomeFichTemp = "Model.docx";

WebClient webClient = new WebClient();

string[] bypasslist = new string[]
{
    "localhost","10.*", ...
};

ICredentials credenciais = new NetworkCredential("domain\user", "password");
            
WebProxy proxy = new WebProxy("http://10.0.32.5:8080", true, bypasslist, credenciais);
webClient.UploadFile(caminho + nomeFichTemp, caminhoPastaFichTemp + nomeFichTemp);

但是我拒绝访问,这是怎么回事

But i get the access denied, what is wrong with this


这篇关于iis中托管的WF服务访问网络共享文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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