12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System;
- using System.IO;
- using DevExpress.XtraRichEdit.API.Native;
- using DevExpress.XtraEditors;
- using System.Linq;
- using System.Windows.Forms;
- using DevExpress.XtraBars;
- namespace NewArchivesCenter
- {
- public partial class LogDetail : DevExpress.XtraEditors.XtraUserControl
- {
- public LogDetail()
- {
- InitializeComponent();
- }
- private void LogDetail_Load(object sender, EventArgs e)
- {
- using (StreamReader sr = new StreamReader(Path.GetTempPath() + @"ArchivesCenter\Data\" + Properties.Settings.Default.current_user + @"\" + Properties.Settings.Default.selectedYText + @"\" + Properties.Settings.Default.selectedMText + @"\" + Properties.Settings.Default.selectedDText + @"\" + "LogInfo.actxt"))
- {
- string firstLine = sr.ReadLine();
- label2.Text = firstLine;
- string secondLine = sr.ReadLine();
- label3.Text = "时间:" + secondLine;
- string thirdLine = sr.ReadLine();
- label4.Text = "作者:" + thirdLine;
- }
- richEditControl1.LoadDocument(Path.GetTempPath() + @"ArchivesCenter\Data\" + Properties.Settings.Default.current_user + @"\" + Properties.Settings.Default.selectedYText + @"\" + Properties.Settings.Default.selectedMText + @"\" + Properties.Settings.Default.selectedDText + @"\" + "content.acdoc");
- gridControlExtension1.CurrentPath = Path.GetTempPath() + @"ArchivesCenter\Data\" + Properties.Settings.Default.current_user + @"\" + Properties.Settings.Default.selectedYText + @"\" + Properties.Settings.Default.selectedMText + @"\" + Properties.Settings.Default.selectedDText + @"\";
- }
- public void CopyDirectory(string srcDir, string destDir)
- {
- if (!Directory.Exists(destDir))
- Directory.CreateDirectory(destDir);
- foreach (string file in Directory.GetFiles(srcDir))
- {
- string dest = Path.Combine(destDir, Path.GetFileName(file));
- File.Copy(file, dest, true);
- }
- foreach (string folder in Directory.GetDirectories(srcDir))
- {
- string dest = Path.Combine(destDir, Path.GetFileName(folder));
- CopyDirectory(folder, dest);
- }
- }
- }
- }
|