- 浏览: 186410 次
- 性别:
- 来自: 湖南
文章分类
- 全部博客 (52)
- 一般 (2)
- java (2)
- 硬件的学习,软件的呼应 (1)
- 硬件知识 (2)
- 数组和队列基础的研究 (1)
- 初步了解文件保存与对io刘深刻的理解 (1)
- io与文件 (1)
- android五大布局 (1)
- Java与mySQL之间的概述 (0)
- mySQL命令口的概述 (1)
- android.多线程.生命周期 (1)
- java.android.the development of voice (1)
- android ConcurrentModificationException 异常 (1)
- linux (1)
- linux shell (1)
- linux 操作系统 进程 c++ 解析 (1)
- C# 画板 实现和通信解析 (0)
- java Mina TCP/IP UDP/IP (1)
- java Mina 通信源码的解析 (1)
- java中数据结构二分查法 (1)
- java中数据结构Bitmap查找相等元素 (1)
- java Bitmap 数据结构 (1)
- 二进制 低级语言 高级语言 (1)
- C# 画板 问题解析 (1)
- C# UDP TCP (1)
- C# 聊天室 过程 (1)
- java Mina 解析 (1)
- web html 语言的标示解析 (1)
- html jsp 乱码解决 (1)
- web java lib jsp的javamail (1)
- JAVA Spring STRUCTS Hibernate (0)
- Java Spring Struts Hibernate (0)
- TCP UDP (1)
- Java Web Spring Struts Hibernate (1)
- LabSQL (1)
- labview labSQL mySQL (1)
- Windows DLL 操作系统 (1)
- R语言 学习包 (1)
- B树 算法 数据结构 (1)
- labview TCP/IP 波形图 (1)
- C++ KMP 数据结构 算法 (1)
- C++ KMP 数据结构 算法 理论 (1)
- 数据结构 B+ B* (1)
- B树 数据结构 结构体 思路 (1)
- B树 高度 性能 思路 (1)
- 顺序Gauss消除法 矩阵 数值分析 C++ (1)
- C++ 排序 数据结构 算法 理论 (1)
- Java 重绘 继承 对象 Wallpaper (0)
- Java 对象 继承 重绘 多态 Wallpaper (1)
- Java Tomcat web 错误解析 (1)
- Java 队列 堆解析 (1)
- Java JDK 优先队列 PriorityQueue (0)
- Java JDK 优先队列 PriorityQueue (1)
- Android JNI C语言 Ubuntu Linux ADB工具 动态链接库so (0)
- Android JNI C语言 Ubuntu Linux ADB工具 动态链接库so (1)
- 研发 核心技术 产品 技术 市场 (0)
最新评论
-
q114687576:
http://www.blue-zero.com/Chat/ ...
C# 聊天室的框架设计实现源码 -
chinesejie:
你用了byte 数组, 其实 空间最多节省 4倍
Bitmap算法查找相等元素源码 -
luozhong915127:
JuliaAilse 写道那个桢布局的。覆盖后可以在需要时再显 ...
android 界面布局 -
这不是我:
很好,很有帮助
R语言中的机器学习包 -
luozhong915127:
什么意思,踩别人连个意见都不给。
优先队列与堆的解析
C#代码
要想QQ一样有聊天室,C#里是个可是编程的软件,呵呵,text和label可以拖就可以了,呵呵。和容易。可是怎样显示字符和怎样获得字符是个事情。嗯,我花了差不多一个是完成了,可是完成之后,好简单的,嗯。与java的差不多,代码如下:
C#代码
namespace TcpIp通信
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为
false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(26,
28);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(395, 241);
this.richTextBox1.TabIndex = 7;
this.richTextBox1.Text = "";
//
// richTextBox2
//
this.richTextBox2.Location = new System.Drawing.Point(40,
299);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.Size = new System.Drawing.Size(381, 133);
this.richTextBox2.TabIndex = 2;
this.richTextBox2.Text = "";
this.richTextBox2.TextChanged += new System.EventHandler
(this.seMsg);
//
// button1
//
this.button1.Location = new System.Drawing.Point(346, 438);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 3;
this.button1.Text = "send";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler
(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(183, 281);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 12);
this.label1.TabIndex = 5;
this.label1.Text = "发送信息";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(185, 13);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(53, 12);
this.label3.TabIndex = 6;
this.label3.Text = "接受信息";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,
12F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(447, 466);
this.Controls.Add(this.label3);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Controls.Add(this.richTextBox2);
this.Controls.Add(this.richTextBox1);
this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
}
}
namespace TcpIp通信
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为
false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.richTextBox2 = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(26,
28);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(395, 241);
this.richTextBox1.TabIndex = 7;
this.richTextBox1.Text = "";
//
// richTextBox2
//
this.richTextBox2.Location = new System.Drawing.Point(40,
299);
this.richTextBox2.Name = "richTextBox2";
this.richTextBox2.Size = new System.Drawing.Size(381, 133);
this.richTextBox2.TabIndex = 2;
this.richTextBox2.Text = "";
this.richTextBox2.TextChanged += new System.EventHandler
(this.seMsg);
//
// button1
//
this.button1.Location = new System.Drawing.Point(346, 438);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 3;
this.button1.Text = "send";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler
(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(183, 281);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 12);
this.label1.TabIndex = 5;
this.label1.Text = "发送信息";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(185, 13);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(53, 12);
this.label3.TabIndex = 6;
this.label3.Text = "接受信息";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F,
12F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(447, 466);
this.Controls.Add(this.label3);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Controls.Add(this.richTextBox2);
this.Controls.Add(this.richTextBox1);
this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
}
}
C#代码
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.Net;
using System.Net.Sockets;
namespace TcpIp通信
{
public partial class Form1 : Form
{
string semsg;
string name;
public Form1()
{
InitializeComponent();
ChatServer();
}
private void button1_Click(object sender, EventArgs e)
{
name = ((Button)sender).Name;
if (name.Equals("button1"))
{
this.richTextBox1.AppendText("服务器说:\n");
this.richTextBox1.AppendText(semsg+"\n");
this.richTextBox2.Text="";
Console.WriteLine("打印成功" + semsg);
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void seMsg(object sender, EventArgs e)
{
semsg = ((RichTextBox)sender).Text;
}
}
}
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.Net;
using System.Net.Sockets;
namespace TcpIp通信
{
public partial class Form1 : Form
{
string semsg;
string name;
public Form1()
{
InitializeComponent();
ChatServer();
}
private void button1_Click(object sender, EventArgs e)
{
name = ((Button)sender).Name;
if (name.Equals("button1"))
{
this.richTextBox1.AppendText("服务器说:\n");
this.richTextBox1.AppendText(semsg+"\n");
this.richTextBox2.Text="";
Console.WriteLine("打印成功" + semsg);
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void seMsg(object sender, EventArgs e)
{
semsg = ((RichTextBox)sender).Text;
}
}
}
<!--EndFragment-->
相关推荐
C#实现Socket聊天室源码 不要分哦~
这是一个用c#编写的在线聊天室,感兴趣的可以下载看看。
此为主要由C#实现的聊天室的功能,有需要的可以看看。
c# 聊天室 socket 源码!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
C#即时通讯聊天室,基于P2P通讯方式的聊天室
C#实现Socket聊天室源码v2 亲,不索分哦~
功能介绍: 界面好看,易开发,易扩展,性能好 界面好看:采用DX 控件开发 易开发:采用插件形式开发,只要另建项目,然后在数据库中加Form的名称就可以 易扩展:可以无限扩展,权限智能配置 ...
资源名字:基于C#+vs.net+SQL Server的多功能聊天软件设计与实现(源码+文档)_C#_vs.net_SQL Server_多功能聊天软件.zip 资源内容:项目全套源码+完整文档 源码说明: 全部项目源码都是经过测试校正后百分百成功...
自然框架源码 自然框架是对现有框架、类库等进行封装、整合,然后按照元数据的描述实现一定的功能。 目前自然框架实现了对.Net FrameWork 2.0 的封装,把一些复杂的操作封装成类库、自定义控件等,以达到简化操作的...
一、源码描述 这是一款界面比较精美的基于WPF技术的开发框架,该框架是作者在开发公司客户端时写的框架, 该框架标题为交通建设项目管理信息化系统。 二、功能介绍 1.代码按照三层结构+MVC模式设计。 2.界面展现...
非常霸气的一款,你面包含了群聊,私聊是局域网聊天的必备良药啊
c# 语音聊天室源码,socket 服务端,客户端完整
一个简单的聊天室C#源码一个简单的聊天室C#源码一个简单的聊天室C#源码一个简单的聊天室C#源码一个简单的聊天室C#源码一个简单的聊天室C#源码一个简单的聊天室C#源码
C# 聊天室源码,供大家一起共同分享学习。
C# QQ 聊天室 C# QQ 聊天室C# QQ 聊天室C# QQ 聊天室C# QQ 聊天室C# QQ 聊天室C# QQ 聊天室
51编程C#敏捷开发框架源码,51编程C#敏捷开发框架源码,51编程C#敏捷开发框架源码
一个简单的聊天室源,C#写的,适合新手学习
[C#源码实例]C#三层框架数据库设计实例教程下载-程序员百味.rar[C#源码实例]C#三层框架数据库设计实例教程下载-程序员百味.rar[C#源码实例]C#三层框架数据库设计实例教程下载-程序员百味.rar[C#源码实例]C#三层框架...
用c#编写的网络聊天室的源码,很好的学习资源。