예제 #1
0
파일: process1.cs 프로젝트: ycx369/NewRepo3
        private void process1_Load(object sender, EventArgs e)
        {
            this.Resize += new EventHandler(Form1_Resize); //窗体调整大小时引发事件
            X            = this.Width;                     //获取窗体的宽度
            Y            = this.Height;                    //获取窗体的高度
            setTag(this);                                  //调用方法
            label2.Left = label1.Right;
            dataGridView1.DataSource = helper.SelectMysqlreturnDataset("select process,product,type from Keyprocess").ToString();
            string path1 = helper.ExecuteScalar("select PathProcess from T_OKKEN where product_type='" + label2.Text + "'").ToString();

            MessageBox.Show(path1);
            DirectoryInfo dir = new DirectoryInfo(@"c:\\123");

            FileInfo[] fil = dir.GetFiles();

            process1 pro = new process1();



            foreach (FileInfo f in fil)
            {
                long size = f.Length;
                //listBox1.Items.Add(f.Name);//添加文件路径到列表中
            }
        }
예제 #2
0
파일: setPath.cs 프로젝트: ycx369/NewRepo3
        //创建文件夹
        private void button2_Click(object sender, EventArgs e)
        {
            string id = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();

            string path1     = helper.ExecuteScalar("select Path from T_OKKEN where product_type='" + id + "'").ToString();
            string creatPath = path1 + @"\" + id;
            //MessageBox.Show(creatPath);
            //Directory.CreateDirectory(creatPath);
            bool exist = Directory.Exists(creatPath);

            if (exist == false && textBox2.Text != "")
            {
                Directory.CreateDirectory(creatPath);
                MessageBox.Show("创建成功!");
            }
            else
            {
                MessageBox.Show("文件夹已存在或路径未设置!");
            }
        }
예제 #3
0
        //ClassLibrary3.DBHelper dbhelper = new ClassLibrary3.DBHelper();


        private void OkkenBOM_Load(object sender, EventArgs e)
        {
            //dataGridView1.DataSource = helper.SelectMysqlreturnDataset("SELECT * FROM [" + label1.Text + "]").Tables[0];
            dataGridView1.DataSource = ClassLibrary3.DBHelper.GetDatasByAdapter("SELECT * FROM [" + label1.Text + "]").Tables[0];
            string pathR = helper.ExecuteScalar("SELECT Path from T_OKKEN where Product_Type= '" + label1.Text + "' ").ToString();
        }