📄 dataobject.cs
字号:
using System;
using System.IO;
namespace myComponents {
public class DataObject {
public void SaveOrder(string customer, string product, double unitPrice, int quantity, string state) {
string strPath = @"c:\orders.txt";
StreamWriter strmFile;
strmFile = File.AppendText( strPath );
strmFile.Write( "customer: " + customer + Environment.NewLine );
strmFile.Write( "product: " + product + Environment.NewLine );
strmFile.Write( "unit price: " + unitPrice.ToString() + Environment.NewLine );
strmFile.Write( "quantity: " + quantity.ToString() + Environment.NewLine );
strmFile.Write( "state: " + state + Environment.NewLine );
strmFile.Write( "=============" + Environment.NewLine );
strmFile.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -