XDFZ/DataSave.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NLKIRADBCommon;
using CommonTools;
using System.Collections;

namespace XDFZ
{
    public partial class DataSave : Form
    {
        public DataSave()
        {
            InitializeComponent();
            this.saveFileDialog1.Filter = "(*.bak)|*.bak";
            this.saveFileDialog1.OverwritePrompt = false;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (this.saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                this.textBox1.Text = this.saveFileDialog1.FileName.Trim();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.textBox1.Text.Trim()))
            {
                MessageBox.Show("请选择备份路径!");
                return;
            }
            string sql = @"BACKUP DATABASE [XDFZ] TO  DISK = N'" + this.textBox1.Text.Trim() + "' WITH NOFORMAT, NOINIT,  NAME = N'111', SKIP, NOREWIND, NOUNLOAD,  STATS = 10";
            DataBase db = DataBaseProvider.CreateDataBase(dbName.AUTO);
            db.ExecuteScalar(sql);
            MessageBox.Show("备份成功!");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.textBox1.Text.Trim()))
            {
                MessageBox.Show("请选还原文件!");
                return;
            }

            //SqlConnection conn = new SqlConnection("Server=.;Database=master;User ID=sa;Password=sasa;Trusted_Connection=False");
            string constr = ConfigurationDataBaseInfo.GetConnectionString("back");
            SqlConnection conn = new SqlConnection(constr);
            conn.Open();

            //KILL DataBase Process
            SqlCommand cmd = new SqlCommand("SELECT spid FROM sysprocesses ,sysdatabases WHERE sysprocesses.dbid=sysdatabases.dbid AND sysdatabases.Name='XDFZ'", conn);
后面还有 37 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。