123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
- {
- public partial class NewFileName : Form
- {
- string folderPath = "";
- string PathName = "";
- public string ChangePathName = "";
- public bool Save = false;
- Hashtable table;
- public NewFileName(string a_Route,string a_PathName)
- {
- folderPath = a_Route;
- PathName = a_PathName;
- ChangePathName = a_PathName;
- InitializeComponent();
- #region 国际化语言
- OTSCommon.Language lan = new OTSCommon.Language(this);
- table = lan.GetNameTable(this.Name);
- #endregion
- }
- private void button1_Click(object sender, EventArgs e)
- {
- // 获取文件夹中的所有文件信息
- FileInfo[] files = new DirectoryInfo(folderPath).GetFiles("*.xml", SearchOption.AllDirectories);
- // 遍历文件信息数组并打印出文件名
- foreach (FileInfo file in files)
- {
- if (file.Name == textBox1.Text + ".xml")
- {
- MessageBox.Show(table["name_repeat"].ToString());
- return;
- }
- }
- ChangePathName = textBox1.Text + ".xml";
- Save = true;
- this.Close();
- }
- private void NewFileName_Load(object sender, EventArgs e)
- {
- }
- }
- }
|