private void button2_Click(object sender, EventArgs e)
{
//弄存檔檔名
saveFileDialog1.ShowDialog();
string save_path = saveFileDialog1.FileName + ".CSV";
int aa = listBox2.Items.Count;
//Save
System.IO.StreamWriter fn = new System.IO.StreamWriter(save_path);
for (int i = 0; i < aa; i++)
{
fn.WriteLine(listBox2.Items[i].ToString());
}
fn.Flush();
fn.Close();
MessageBox.Show("存檔成功 ^^=");
}
2010年1月21日 星期四
2010年1月20日 星期三
[C#] Listbox 存至 CSV
private void button2_Click(object sender, EventArgs e)
{
//弄存檔檔名
saveFileDialog1.ShowDialog();
string save_path = saveFileDialog1.FileName + ".CSV";
int aa = listBox3.Items.Count;
//Save
System.IO.StreamWriter fn = new System.IO.StreamWriter(save_path);
for (int i = 0; i < aa; i++)
{
fn.WriteLine(listBox3.Items[i].ToString().Replace("=", ","));
}
fn.Flush();
fn.Close();
MessageBox.Show("存檔成功 ^^=");
}
{
//弄存檔檔名
saveFileDialog1.ShowDialog();
string save_path = saveFileDialog1.FileName + ".CSV";
int aa = listBox3.Items.Count;
//Save
System.IO.StreamWriter fn = new System.IO.StreamWriter(save_path);
for (int i = 0; i < aa; i++)
{
fn.WriteLine(listBox3.Items[i].ToString().Replace("=", ","));
}
fn.Flush();
fn.Close();
MessageBox.Show("存檔成功 ^^=");
}
標籤:
C#
2010年1月19日 星期二
[SQL] 從Excel 匯入至 SQL
SELECT * INTO DAQ FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\1.xls', [Sheet1$])
標籤:
SQL
2010年1月4日 星期一
訂閱:
文章 (Atom)

