我现在当前用户的桌面上用C#创建一个TXT,请问怎么实现??
请高手指点

解决方案 »

  1.   

    File.WriteAllText(@"C:\Documents and Settings\All Users\桌面\a.txt", "123456", Encoding.Default);
      

  2.   

    using System;
    using System.Collections.Generic;
    using System.Text;namespace ConsoleApplication29
    {
        class Program
        {
            static void Main(string[] args)
            {
                string str= System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
                System.IO.StreamWriter sw = System.IO.File.CreateText(str+@"\jinjazz.txt");
                sw.WriteLine("接分");
                sw.Close();        }
             
        }
    }