這裏是我的問題:如何創建按鈕新建一個文本文件,然後單擊
我開發一個Windows應用程序
我將圖像轉換成文本格式,並將其保存到系統中的位置。
這是我的代碼:
if (!System.IO.Directory.Exists("D:\\SaveImageOutPutFolder"))
{
System.IO.Directory.CreateDirectory("D:\\SaveImageOutPutFolder");
doc.Save(ConfigurationSettings.AppSettings["SaveImagefolderPath"] [email protected]"\\MytxtFile.txt", Leadtools.Forms.DocumentWriters.DocumentFormat.Text, null);
MessageBox.Show("folder created and image output saved");
}
else
{
doc.Save(ConfigurationSettings.AppSettings["SaveImagefolderPath"] + @"\\MytxtFile.txt", Leadtools.Forms.DocumentWriters.DocumentFormat.Text, null);
MessageBox.Show("ImageFolder is available images are Saved into folder Now");
}
的問題是,它不是每次單擊按鈕時創建一個新的文本文件。它正在寫入同一個文件。我想爲每次點擊創建一個新的txt文件。
可以anyboy幫助這個,並給我一些示例代碼?
爲什麼大家都沉迷於CAPS LOCK? –
什麼是doc類型? 另外,圖像內容是二進制格式。所以如果你閱讀,你會得到一個bytearray數據。現在將它寫入文本文件有什麼用處? – Zenwalker