首页上一页 1 下一页尾页 4 条记录 1/1页
folderBrowserDialog显示不了目录树是什么原因呀?请老师指点一下,谢谢。
发表在C#图书答疑
2010-08-27
是否精华
是
否
版块置顶:
是
否
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace IT部门管理系统
{
public partial class frm_dataBak : Form
{
public frm_dataBak()
{
InitializeComponent();
}
cls_dbOpSql dbOp = new cls_dbOpSql(); //实例化数据库操作类
private void btnSel_Click(object sender, EventArgs e) [font color=#FF0000]//就是此处代码不知为什么,请老师指点一下,谢谢。
[/font] {
folderBrowserDialog1.ShowDialog();
txtDSPath.Text = folderBrowserDialog1.SelectedPath.ToString().Trim() + "\\";
}
private void btnDStore_Click(object sender, EventArgs e)
{
try
{
if (File.Exists(txtDSPath.Text.Trim() + ".bak"))
{
MessageBox.Show("该文件已经存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
txtDSPath.Text = "";
txtDSPath.Focus();
}
else
{
dbOp.getcom("backup database itSys to disk='" + txtDSPath.Text.Trim() + " "+label2.Text.ToString()+".bak'");
MessageBox.Show("数据备份成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void frm_dataBak_Load(object sender, EventArgs e)
{
cls_autoNum num = new cls_autoNum();
label2.Text = num.tb_EmpInfoID();
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace IT部门管理系统
{
public partial class frm_dataBak : Form
{
public frm_dataBak()
{
InitializeComponent();
}
cls_dbOpSql dbOp = new cls_dbOpSql(); //实例化数据库操作类
private void btnSel_Click(object sender, EventArgs e) [font color=#FF0000]//就是此处代码不知为什么,请老师指点一下,谢谢。
[/font] {
folderBrowserDialog1.ShowDialog();
txtDSPath.Text = folderBrowserDialog1.SelectedPath.ToString().Trim() + "\\";
}
private void btnDStore_Click(object sender, EventArgs e)
{
try
{
if (File.Exists(txtDSPath.Text.Trim() + ".bak"))
{
MessageBox.Show("该文件已经存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
txtDSPath.Text = "";
txtDSPath.Focus();
}
else
{
dbOp.getcom("backup database itSys to disk='" + txtDSPath.Text.Trim() + " "+label2.Text.ToString()+".bak'");
MessageBox.Show("数据备份成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void frm_dataBak_Load(object sender, EventArgs e)
{
cls_autoNum num = new cls_autoNum();
label2.Text = num.tb_EmpInfoID();
}
}
}