如何解决我无法在C#Windows服务中将文件同步到网络路径的问题 [英] How do I fix that I can't sync file to network path in C# Windows Service

查看:64
本文介绍了如何解决我无法在C#Windows服务中将文件同步到网络路径的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#Windows服务项目。

我正在使用Microsoft同步服务将我的文件同步到服务器。

我想要同步文件到服务器(网络路径,例如' \\192.168.1.2 \File \ ')。

但是我发现错误' 找不到路径的一部分'\\\\\\\\\\\\ '。

如何解决该错误。

I'm using C# Windows Service project.
And I'm using Microsoft Synchronization service to sync my file to server.
I want sync file to server (to network path e.g. '\\192.168.1.2\File\').
But I found a error that 'Could not find a part of the path '\\192.168.1.2\File\''.
How can I fix that error.

推荐答案

根据您使用服务的事实,我猜测该服务的运行方式与您用于桌面会话的帐户不同。



例如,如果您使用纯本地帐户进行服务,则它无权访问网络资源。



因此,作为解决方案,请尝试在其他帐户下运行该服务。
Based on the fact that you're using a service I would guess that the service is run under different account than what you use for desktop session.

For example if you use purely local account for the service, it does not have privileges to access network resources.

So as a resolution, try running the service under a different account.


这篇关于如何解决我无法在C#Windows服务中将文件同步到网络路径的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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