开发者

C# using redirection operators in visual studio

I am conve开发者_开发技巧rting a C program to C# and using MS Visual Studio 2005. In C program the arguments are passed as

CProg.exe DataFile < ParameterFile > OutPutFile

When I use above parameters in my project settings of C project, it works fine. Standard Input device is now redirected to "ParameterFile" and standard output device to "OutPutFile".

But when I use it with C# project, it does not redirect StdIn or SdtOut devices. In the application (while debugging it with Visual studio) I get all these values as arguments (including "<" and ">").

But when I run the C# application through command prompt, it works fine (same as C application).

It seems that MS Visual Studio 2005 does not understand redirection operators while debugging the application.

Or am I missing some settings?? Please suggest.


I'm not sure VS 2005 supports them. If this only happens in debug mode, have you considered hard coding the output redirection? Instead of writing to the console, just write to a file stream and same for read operations. It shouldn't be that hard to change, even if you have tons or IO. Then when you have the working program change it back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜