除了。txt,还有什么地方可以用c#插入数据呢?
string file = GenerarPath(Environment.SpecialFolder.MyDocuments, "Pascal Triangle.txt");
var tw = new StreamWriter(file);
Console.WriteLine("tt Pascal Triangle in C#");
Console.WriteLine("t________________________________________");
Console.Write("nNumber of Rows: ");
int number = int.Parse(Console.ReadLine());
int x = number * 2;
for (int i = 0; i <= number; ++i, x -= 2)
{
for (int s = 0; s <= x; ++s)
tw.Write(" ");
for (int k = 0; k <= i; ++k)
//Console.Write(String.Format("{0,4:D}", formula(i, k)));
tw.Write(String.Format("{0,4:D}",pascal(i,k)));//formula(i, k)));
tw.WriteLine();
}
tw.Close();
Console.WriteLine("Finished");
Console.ReadKey();
谢谢
几乎在任何地方。如数据库(Sqlserver, access), word文件,txt文件等。