master
editor 5 months ago
commit 62e927b053

@ -0,0 +1,36 @@
AJAX实现的在线聊天室
一、源码描述
环境VS2022 
二、功能介绍
一个单一的多用户聊天室。其内部维护着一个已登录用户的列表。列表将祛除session过期的用户。同时它还支持一些命令比如 /admin Clear 清除聊天室 /nick [Name] 改变用户姓名,详细的自己去发掘了。
注意用户名不能为汉字且不包含数字!
三、注意事项
ctrl+F5运行即可。
作者: uchat
如需获得该源码的视频、更新等更多资料请访问: https://www.51aspx.com/Code/AjaxChat
------------------------------------------------------------------------------------------------
源码服务专家
官网: https://www.51aspx.com
讨论圈: https://club.51aspx.com/
平台声明:
1.51Aspx平台上提供下载的资源为免费、共享、商业三类源码,其中免费和共享源码仅供个人学习和研究使用,商业源码请在相应的授权许可条件下使用;
2.51Aspx平台对提供下载的软件及其它资源不拥有任何权利,其版权归属源码合法拥有者所有;
3.著作权人发现本网站载有侵害其合法权益的内容或作品,请与我们联系( 登录官网与客服反馈或发送邮件到support@51Aspx.com
4.51Aspx平台不保证提供的下载资源的准确性、安全性和完整性;
友情提示:
一般数据库文件默认在 DB_51Aspx 文件夹下
默认账号密码一般均为51Aspx
关于源码使用常见问题及解决方案,请参阅: https://www.51aspx.com/Help

@ -0,0 +1,15 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]

@ -0,0 +1,36 @@
AJAX实现的在线聊天室
一、源码描述
环境VS2022 
二、功能介绍
一个单一的多用户聊天室。其内部维护着一个已登录用户的列表。列表将祛除session过期的用户。同时它还支持一些命令比如 /admin Clear 清除聊天室 /nick [Name] 改变用户姓名,详细的自己去发掘了。
注意用户名不能为汉字且不包含数字!
三、注意事项
ctrl+F5运行即可。
作者: uchat
如需获得该源码的视频、更新等更多资料请访问: https://www.51aspx.com/Code/AjaxChat
------------------------------------------------------------------------------------------------
源码服务专家
官网: https://www.51aspx.com
讨论圈: https://club.51aspx.com/
平台声明:
1.51Aspx平台上提供下载的资源为免费、共享、商业三类源码,其中免费和共享源码仅供个人学习和研究使用,商业源码请在相应的授权许可条件下使用;
2.51Aspx平台对提供下载的软件及其它资源不拥有任何权利,其版权归属源码合法拥有者所有;
3.著作权人发现本网站载有侵害其合法权益的内容或作品,请与我们联系( 登录官网与客服反馈或发送邮件到support@51Aspx.com
4.51Aspx平台不保证提供的下载资源的准确性、安全性和完整性;
友情提示:
一般数据库文件默认在 DB_51Aspx 文件夹下
默认账号密码一般均为51Aspx
关于源码使用常见问题及解决方案,请参阅: https://www.51aspx.com/Help

@ -0,0 +1,15 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]

@ -0,0 +1,15 @@
<%@ Page language="c#" Codebehind="Chat.aspx.cs" AutoEventWireup="false" Inherits="UChat.Chat" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>UChat</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link rel="stylesheet" href=css/niftyCorners.css />
<link rel="stylesheet" href=css/style.css />
<script type="text/javascript" src=js/AjaxFunctions.js></script>

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace UChat
{
/// <summary>
/// Summary description for Chat.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...

@ -0,0 +1,15 @@
using System;
using System.Text;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
namespace UChat.ChatEngine
{
public class ChatEngine : IChatEngine
{
const string msg = "<li class=\"{0}\">{1}</li>\r\n";
const string userlistfmt = "<li>{0}</li>\r\n";
const string serverstyle = "servermsg";
const string userstyle = "usermsg";

@ -0,0 +1,15 @@
using System;
namespace UChat.ChatEngine
{
public interface IChatEngine
{
/// <summary>
/// HTML Formatted user list
/// </summary>
string UserList
{
get;
}
/// <summary>
/// Get the list of currently

@ -0,0 +1,15 @@
<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="UChat.Pages.Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Default</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script type="text/javascript" src=js/niftycube.js></script>
<link rel="stylesheet" href=css/niftyCorners.css />
<link rel="stylesheet" href=css/style.css />
<script type="text/javascript">

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace UChat.Pages
{
/// <summary>
/// Summary description for WebForm1.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...

@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="UChat.Global" %>

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
namespace UChat
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// Required designer variable.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />

@ -0,0 +1 @@
<%@ Page language="c#" Codebehind="Server.aspx.cs" AutoEventWireup="false" Inherits="UChat.Server.Server" %>

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace UChat.Server
{
/// <summary>
/// Summary description for Server.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...

@ -0,0 +1,15 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Web"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{F88B3428-9EDD-4F54-8CD6-C46AF80202BC}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "UChat"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation

@ -0,0 +1,15 @@
/*Nifty Corners Cube CSS by Alessandro Fulciniti
The following classes are added dinamically by javascript,
and their use should be avoided in the markup */
b.niftycorners,b.niftyfill{display:block}
b.niftycorners *{display:block;height: 1px;line-height:1px;font-size: 1px;
overflow:hidden;border-style:solid;border-width: 0 1px}
/*normal*/
b.r1{margin: 0 3px;border-width: 0 2px}
b.r2{margin: 0 2px}
b.r3{margin: 0 1px}
b.r4{height: 2px}
b.rb1{margin: 0 8px;border-width:0 2px}
b.rb2{margin: 0 6px;border-width:0 2px}
b.rb3{margin: 0 5px}

@ -0,0 +1,15 @@
body
{
padding-right: 10px;
margin-top: 0px;
padding-left: 10px;
padding-bottom: 10px;
margin-left: auto;
width: 80%;
margin-right: auto;
padding-top: 0px;
font-family: verdana;
}
#header {

@ -0,0 +1,15 @@
//Global variables
var timeID;
var refreshRate = 2000; // two seconds
var rnd = Math.random();
var isFirefox;
var isIE;
//var XmlHttp;
var AjaxServerPageName;
AjaxServerPageName = "Server.aspx";
//Creating and setting the instance of appropriate XMLHTTP Request object to a <20>XmlHttp<74> variable
function getAjax()
{

@ -0,0 +1,15 @@
/* Nifty Corners Cube - rounded corners with CSS and Javascript
Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software

@ -0,0 +1,15 @@
<%@ Page language="c#" Codebehind="Chat.aspx.cs" AutoEventWireup="false" Inherits="UChat.Chat" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>UChat</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link rel="stylesheet" href=css/niftyCorners.css />
<link rel="stylesheet" href=css/style.css />
<script type="text/javascript" src=js/AjaxFunctions.js></script>

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace UChat
{
/// <summary>
/// Summary description for Chat.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...

@ -0,0 +1,15 @@
using System;
using System.Text;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
namespace UChat.ChatEngine
{
public class ChatEngine : IChatEngine
{
const string msg = "<li class=\"{0}\">{1}</li>\r\n";
const string userlistfmt = "<li>{0}</li>\r\n";
const string serverstyle = "servermsg";
const string userstyle = "usermsg";

@ -0,0 +1,15 @@
using System;
namespace UChat.ChatEngine
{
public interface IChatEngine
{
/// <summary>
/// HTML Formatted user list
/// </summary>
string UserList
{
get;
}
/// <summary>
/// Get the list of currently

@ -0,0 +1,3 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|21 Dec 2005 01:09:56 -0000
vti_extenderversion:SR|4.0.2.7802

@ -0,0 +1,3 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|21 Dec 2005 00:11:54 -0000
vti_extenderversion:SR|4.0.2.7802

@ -0,0 +1,15 @@
<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="UChat.Pages.Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Default</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script type="text/javascript" src=js/niftycube.js></script>
<link rel="stylesheet" href=css/niftyCorners.css />
<link rel="stylesheet" href=css/style.css />
<script type="text/javascript">

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace UChat.Pages
{
/// <summary>
/// Summary description for WebForm1.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...

@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="UChat.Global" %>

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
namespace UChat
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// Required designer variable.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />

@ -0,0 +1 @@
<%@ Page language="c#" Codebehind="Server.aspx.cs" AutoEventWireup="false" Inherits="UChat.Server.Server" %>

@ -0,0 +1,15 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace UChat.Server
{
/// <summary>
/// Summary description for Server.

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProductVersion>7.10.3077</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F88B3428-9EDD-4F54-8CD6-C46AF80202BC}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon />
<AssemblyKeyContainerName />
<AssemblyName>UChat</AssemblyName>
<AssemblyOriginatorKeyFile />
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<configuration>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.8" />
</system.Web>
-->
<system.web>
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb information)

@ -0,0 +1,8 @@
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|21 Dec 2005 01:02:50 -0000
vti_extenderversion:SR|4.0.2.7802
vti_cacheddtm:TX|21 Dec 2005 01:02:50 -0000
vti_filesize:IR|1936
vti_cachedlinkinfo:VX|S|../images/header.jpg
vti_cachedsvcrellinks:VX|NSUS|images/header.jpg
vti_backlinkinfo:VX|

@ -0,0 +1,15 @@
/*Nifty Corners Cube CSS by Alessandro Fulciniti
The following classes are added dinamically by javascript,
and their use should be avoided in the markup */
b.niftycorners,b.niftyfill{display:block}
b.niftycorners *{display:block;height: 1px;line-height:1px;font-size: 1px;
overflow:hidden;border-style:solid;border-width: 0 1px}
/*normal*/
b.r1{margin: 0 3px;border-width: 0 2px}
b.r2{margin: 0 2px}
b.r3{margin: 0 1px}
b.r4{height: 2px}
b.rb1{margin: 0 8px;border-width:0 2px}
b.rb2{margin: 0 6px;border-width:0 2px}
b.rb3{margin: 0 5px}

@ -0,0 +1,15 @@
body
{
padding-right: 10px;
margin-top: 0px;
padding-left: 10px;
padding-bottom: 10px;
margin-left: auto;
width: 80%;
margin-right: auto;
padding-top: 0px;
font-family: verdana;
}
#header {

@ -0,0 +1,15 @@
//Global variables
var timeID;
var refreshRate = 2000; // two seconds
var rnd = Math.random();
var isFirefox;
var isIE;
//var XmlHttp;
var AjaxServerPageName;
AjaxServerPageName = "Server.aspx";
//Creating and setting the instance of appropriate XMLHTTP Request object to a <20>XmlHttp?variable
function getAjax()
{

@ -0,0 +1,15 @@
/* Nifty Corners Cube - rounded corners with CSS and Javascript
Copyright 2006 Alessandro Fulciniti (a.fulciniti@html.it)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Loading…
Cancel
Save