0
Dim myProcess As System.Diagnostics.Process = New System.Diagnostics.Process()

myProcess.StartInfo.UseShellExecute = True
myProcess.StartInfo.FileName = "C:\Program Files (x86)\IrfanView\i_view32.exe"
myProcess.StartInfo.Arguments = sFileName
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
myProcess.Start()

当文件位于本地驱动器上时,上面在 Irfanview 中打开 tif 图像的代码可以完美运行。如果文件在网络共享上,Irfanview 将在标题栏中显示为挂起(未响应)。这是 Windows 7 的新行为。在同一网络上的 Windows XP 机器上,我没有这个问题。

知道为什么吗?

格雷格

[编辑]

我还尝试了下面的代码,但没有成功,并尝试了 irfanview 旁边的另一个图像查看器并得到了相同的结果。使用此代码 irfanview 告诉我它不是有效文件,并显示文件的确切路径和文件名。很烦人。旧的 Windows API ShellExecute 不会启动程序。呸呸呸!!!

Dim domain As String = {domain}
Dim uname As String = {username}
Dim passwordtx As String = {password}
Dim password As New System.Security.SecureString()
Dim c As Char
For Each c In passwordtx
    password.AppendChar(c)
Next c

Dim myProcess As System.Diagnostics.Process = New System.Diagnostics.Process()

myProcess.StartInfo.UseShellExecute = True
myProcess.StartInfo.FileName = "C:\Program Files (x86)\IrfanView\i_view32.exe"
myProcess.StartInfo.Arguments = sFileName
myProcess.StartInfo.WorkingDirectory = "C:\"
myProcess.StartInfo.UserName = uname
myProcess.StartInfo.Domain = domain
myProcess.StartInfo.Password = password
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
myProcess.Start()
4

1 回答 1

1

它与代码无关。问题是文件夹中的文件太多,而 irfanview 试图将它们全部编入目录,或者做类似的事情。我需要按月或其他时间分解文件。

格雷格

于 2013-10-31T22:19:45.963 回答