本文介绍了传递命令行参数使用Visual Studio C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何设置的命令行参数我使用的Visual Studio开发一个应用程序,它是一个控制台应用程序。我已经在Eclipse上做到了这一点,有没有在Visual Studio中的类似选项?
How do I set the command line arguments for an application I am developing using Visual Studio , it is a console application. I've done this on eclipse, is there a similar option on Visual Studio?
推荐答案
则一定是与你的Visual Studio,如果你不看命令行参数
。
Something must be wrong with your Visual Studio if you don't see Command Line Arguments
.
如果你不能修复您的Visual Studio中,有一个选项,以 StartArguments
元素添加到您的 .csproj.user
文件:
If you can't fix your Visual Studio, there is an option to add StartArguments
element to your .csproj.user
file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory />
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartArguments>Argument1 Argument2</StartArguments> <<== THIS LINE
</PropertyGroup>
</Project>
这篇关于传递命令行参数使用Visual Studio C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!