首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

关于Winform保存到Txt文件里!解决办法

2012-02-20 
关于Winform保存到Txt文件里!!!!!!!!!!!!!小弟我做了个货单,并且做了个 保存按纽,想保存到Txt文件里,我这

关于Winform保存到Txt文件里!!!!!!!!!!!!!
小弟我做了个货单,并且做了个 保存按纽,想保存到Txt文件里,我这可怜的书太垃圾了,跟本就没有!


请教下大哥们,我现在才注册好象有100分,但不知道怎么给,如果能给 我就给你们啊!!!!

[解决办法]

C# code
using System;using System.Collections.Generic;using System.Text;using System.IO;namespace ConsoleApplication10{    class Program    {        static void Main(string[] args)        {            try            {                StreamWriter sw = new StreamWriter("C:\\test.txt");                sw.WriteLine("Test");                sw.Close();            }            catch (Exception ex)            {                Console.WriteLine("Err: " + ex.Message);            }            finally            {                Console.WriteLine("Write END");            }            Console.ReadLine();                                }    }} 

热点排行