【发布时间】:2014-03-14 02:45:04
【问题描述】:
我使用 Visual Studio 在 C# 中开发了程序,并在 Debug 文件夹中生成了 .exe 文件。我还在 Properties-> Debug 中添加了命令行参数。
传递的参数是 D:\Example\bin\Release\Input_Files\ D:\Example\bin\Debug\trycc.css 900 640
通过将解决方案配置标记为 Debug 来运行此解决方案,它会在 Debug 文件夹中生成 .exe 文件。
当我尝试从它告诉的命令行运行时,无法打开与 .exe 处于同一级别的某些文件。
D:\>D:\Example\bin\Debug\Example.exe D:\Example\bin\Release\Input_Files\ D:\Example\bin\Debug\trycc.css 900 640
我不明白我哪里出错了。请帮忙。
这里是:
D:\>D:\Example\bin\Debug\DFu1.exe "D:\Example\bin\Release\I
nput_Files\" "D:\Example\bin\Release\Input_Files\css\screen.css" "900
" "830"
Incomplete Arguments entered.
Press any key to continue
Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part
of the path 'C:\Out\elogs.txt'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I
nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o
ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at ExampleParser.Program.Main(String[] args) in D:\Example\Program.cs:l
ine 691
【问题讨论】:
-
这可能是工作目录的问题,或者您需要将参数放在引号“”之间。您可以从命令提示符复制粘贴整个输出吗?如果您不知道如何 - 右键单击命令提示符窗口,标记,选择行,右键单击,它将出现在您的剪贴板中(您可以在此处使用 CTRL+V)。
-
我已经编辑了..请看一下
标签: c# visual-studio exe