如何使system.diagnostics.process访问64位进程的模块 [英] How to make system.diagnostics.process to access modules of a 64 bit process

查看:74
本文介绍了如何使system.diagnostics.process访问64位进程的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过批处理文件进行gpg加密

但是

我得到'32位进程无法访问64位进程的模块。'异常调用进程.Start()



我尝试过:



这是我的代码示例

Dim gpgPath As String = System.IO.Directory.GetDirectoryRoot(AppDomain.CurrentDomain.BaseDirectory)& ABProreports\ME_ONBOARDING\Encryption\&格式(Date.Now,ddMMyyyy)

Dim mFileNo As Byte = 1



Dim myProcess As New System.Diagnostics.Process

myProcess.StartInfo.WorkingDirectory = System.IO.Directory.GetDirectoryRoot(AppDomain.CurrentDomain.BaseDirectory)& APP_SERVER \ ABPro \

myProcess.StartInfo.FileName =(gpgPath&\ Encrypt_& mFileNo&。bat)

myProcess .StartInfo.UseShellExecute = False

myProcess.StartInfo.RedirectStandardOutput = True

myProcess.Start()

I am trying to do gpg encryption through batch file
But
I get 'A 32 bit processes cannot access modules of a 64 bit process.' exception invoking Process.Start()

What I have tried:

Here is a sample of my code
Dim gpgPath As String = System.IO.Directory.GetDirectoryRoot(AppDomain.CurrentDomain.BaseDirectory) & "ABProreports\ME_ONBOARDING\Encryption\" & Format(Date.Now, "ddMMyyyy")
Dim mFileNo As Byte = 1

Dim myProcess As New System.Diagnostics.Process
myProcess.StartInfo.WorkingDirectory = System.IO.Directory.GetDirectoryRoot(AppDomain.CurrentDomain.BaseDirectory) & "APP_SERVER\ABPro\"
myProcess.StartInfo.FileName = (gpgPath & "\Encrypt_" & mFileNo & ".bat")
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.Start()

推荐答案

如果你想运行一个批处理文件,你应该这样做:

If you want to run a batch file, you should do it like this:
myProcess.StartInfo.UseShellExecute = True
myProcess.StartInfo.RedirectStandardOutput = False

请注意,您不能以这种方式使用RedirectStandardOutput!

Note that you can't use RedirectStandardOutput this way !


这篇关于如何使system.diagnostics.process访问64位进程的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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