Form1.cs
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
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;
using System.Data.SqlClient;
using System.Threading;
namespace sql
{
public partial class Form1 : Form
{
string connectstring;
SqlConnection cn;
List<string> list = new List<string>();
List<string> li = new List<string>();
string userId = "";
string password = "";
string database = "";
public Form1()
{
InitializeComponent();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
textBox2.Enabled = textBox3.Enabled = !checkBox1.Checked;
}
private void button1_Click(object sender, EventArgs e)
{
groupBox2.Enabled = true;
database = textBox1.Text;
userId = textBox2.Text;
password = textBox3.Text;
try
{
string sql = string.Format("select name from sys.databases");
if (checkBox1.Checked)
{
connectstring = string.Format(" data source={0}; initial catalog=master;integrated security=sspi", database);
}
else
{
connectstring = string.Format(" data source={0}; initial catalog=master;user id={1};password={2}", database, userId, password);
}
cn = new SqlConnection(connectstring);
cn.Open();
SqlCommand cm = new SqlCommand(sql, cn);
SqlDataReader dr = cm.ExecuteReader();
while (dr.Read())
{
后面还有 216 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。