migrate to new git

This commit is contained in:
2025-08-29 01:27:25 +08:00
parent 946eb9961e
commit af2c152ef6
8623 changed files with 1000453 additions and 1 deletions

35
web/sites_test.aspx.cs Normal file
View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class sites_test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string site_id = HttpContext.Current.Request.Url.Host;
var conn_config = ConfigurationManager.ConnectionStrings[site_id];
string title = Sites.sites.FirstOrDefault(q => q.url == site_id)?.title;
string conn_str = conn_config==null?"(N/A)": conn_config.ConnectionString;
int n = 40;
string conn_str_test = "(N/A)";
if (conn_str.Length>n)
{
conn_str_test=conn_str.Substring(0, n) + "......" + conn_str.Right(n);
}
Label1.Text = site_id;
Label4.Text = conn_str_test;
}
}
public static class StringExtensions
{
public static string Right(this string str, int length)
{
return str.Substring(str.Length - length, length);
}
}