WELOA.DAL/WEL/ls_exception.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using WELOA.Model;
using System.Configuration;

namespace LSDAL_SQL
{
    public class ls_exception
    {
        
        public Polytechnic delexception()
        {
            Polytechnic Polytechnic = new Polytechnic
            {
                nException = -1,
                rowsnum = -1
            };
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandType = CommandType.Text;
                command.CommandText = "DELETE ls_exception WHERE time<'" + DateTime.Now.AddMonths(-1) + "'";
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    Polytechnic.rowsnum = command.ExecuteNonQuery();
                }
                catch (Exception exception)
                {
                    new ls_exception().insexception("ls_exception.cs delexception", exception.Message);
                    Polytechnic.nException = 1;
                    return Polytechnic;
                }
            }
            return Polytechnic;
        }

        public void insexception(string files, string exceptions)
        {
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["lsstring"].ConnectionString))
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandType = CommandType.Text;
                command.CommandText = "INSERT INTO ls_exception (time,files,exceptions) VALUES ('" + DateTime.Now.ToString() + "',@files,@exceptions)";
                command.Parameters.AddWithValue("@files", files);
                command.Parameters.AddWithValue("@exceptions", exceptions);
                try
                {
                    if (connection.State == ConnectionState.Closed)
                    {
                        connection.Open();
                    }
                    command.ExecuteNonQuery();
后面还有 8 行代码,解锁后查看完整代码

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

AI 解读

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

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