在没有用户登录的控制台应用程序中映射驱动器 [英] Map drive in console app with no user logged in

查看:39
本文介绍了在没有用户登录的控制台应用程序中映射驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将控制器应用程序中的驱动器映射为由事件触发的计划任务。



<我需要使用应用程序映射驱动器,完成一个过程,然后在使用后断开连接。


我正在引用(链接)但遇到密码错误的问题,即使我知道
这是一个有效的密码,因为我已经多次验证过。


我无法粘贴我的代码,因为我们的互联网是在分段网络上,与我们的生产分开,但地图功能都基于提供的链接。


用户名是域帐户的用户名,并且已尝试格式为DOMAIN \Username,用户名@ DOMAIN和用户名。


密码也标记了错误,由15个字符组成,至少有1个字符,1个字符和1个字符d一个特殊字符,以防万一此方法不允许这样做。



感谢您提供的任何帮助。

解决方案

您好Ryan,


根据您的描述,输入用户名和密码时会遇到一些问题。我找到一个使用
Win32API执行此操作的示例,您可以参考:


http://www.mredkj.com/vbnet/vbnetmapdrive.html


而且我不确定它是什么问题,所以我们在这里提供一些代码是有用的。


最好的问候,


樱桃


I am trying to map a drive within a console application that runs as a scheduled task that is triggered by an event.

I need to map a drive with the application, complete a process and then disconnect it after usage.

I am referencing (Link) but running into issues of wrong password, even though I know it is a valid password as I have verified it numerous times.

I can not paste my code as our internet is on a segmented network, separate from our production but the map functionality is all based on the provided link.

Username is that of a domain account and has been tried in formats DOMAIN\Username, Username@DOMAIN and Username.

The password has flagged an error as well and consist of 15 characters with at least 1 upper, 1 number and one special character, just in case these are not allowed in this method.

I appreciate any assistance you can provide.

解决方案

Hi Ryan,

According to your description, you have some issue when you enter username and password. I find one example that using Win32API to do this, you can refer to:

http://www.mredkj.com/vbnet/vbnetmapdrive.html

And I am not sure what problem it is, so it is useful to us to provide some code here.

Best Regards,

Cherry


这篇关于在没有用户登录的控制台应用程序中映射驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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