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将显示为挂起,标题栏中显示为(无响应)。这是Windows7的新行为。在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()发布于 2013-11-01 06:19:46
这与代码无关。问题是文件夹中有太多的文件,irfanview正在尝试对它们进行分类,或者做类似的事情。我需要按月或者别的什么来分解这些文件。
格雷格
https://stackoverflow.com/questions/19711631
复制相似问题