Files
2026-05-29 10:07:05 +08:00

68 lines
1.7 KiB
C#

using System;
//using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Net;
using System.Web;
using System.IO;
using System.Text.RegularExpressions;
using System.Net.Sockets;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Threading;
using System.Data.OleDb;
using SystemFramework;
//using SystemFramework;
namespace DataLinkMesWork
{
public partial class DataAccess
{
/// <summary>
/// 测试与数据的连接线程
/// </summary>
static Thread threadTestConnection;
/// <summary>
/// 测试与数据的连接
/// </summary>
/// <returns></returns>
public static void TestConnection()
{
try
{
if (threadTestConnection == null)
{
threadTestConnection = new Thread(new ThreadStart(SQLCommon.TestConnection));
threadTestConnection.Start();
}
else
{
threadTestConnection.Abort();
threadTestConnection = null;
threadTestConnection = new Thread(new ThreadStart(SQLCommon.TestConnection));
threadTestConnection.Start();
}
}
catch (Exception err)
{
ApplicationLog.WriteLog(err, err.Source);
}
}
/// <summary>
/// 测试与数据的连接
/// </summary>
/// <returns></returns>
public static void TestConnectionFirst()
{
SQLCommon.TestConnection();
}
}
}