开发者

how to run any file and how to write to file - in C# - Visual studio 2003?

开发者 https://www.devze.com 2023-03-02 02:12 出处:网络
i have to work on old project that written on Visual-St开发者_如何学Pythonudio 2003 (windows-mobile 5.0)

i have to work on old project that written on Visual-St开发者_如何学Pythonudio 2003 (windows-mobile 5.0)

and i dont know how to do this:

  1. how to run any file from the program (for example need to run prog2.exe)

  2. how to write to MyText.txt the word "TEST"

thank in advance


For the first, use Process.Start.

For the second, in the Compact Framework you'd need:

using (TextWriter writer = new TextWriter("test.txt"))
{
    writer.Write("TEST");
}

I believe Process.Start should be okay in Windows Mobile though...

If you can upgrade to a later version of the Compact Framework, you could use File.WriteAllText.

0

精彩评论

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