• 大小: 10.15M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-08
  • 语言: 其他
  • 标签: 其他  

资源简介

C开发典型模块大全2-13.rar

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using QQClass;
using System.IO;

namespace MyQQClient
{
    public partial class F_Chat : Form
    {
        public UDPSocket udpsocket;
        public ClassForms FormList;
        public bool Voiding;
        public bool SendViod;
        cVideo viodeo;

        public F_Chat()
        {
            InitializeComponent();
        }

        private void button_Send_Click(object sender EventArgs e)
        {
            IPAddress ip = IPAddress.Parse(Publec_Class.ServerIP);//服务器端的IP地址
            string port = Publec_Class.ServerPort;//端口号
            string revid = ((this.Tag as TreeNode).Tag as ClassUserInfo).UserID;//接收ID号
            string sid = Publec_Class.UserID;//发送ID
            string msgid = Guid.NewGuid().ToString();//设置全局惟一标识

            byte[] data = Encoding.Unicode.GetBytes(rich_Input.Rtf);//将当前要发送的信息转换成二进制流
            ClassMsg msg = new ClassMsg();
            msg.sendKind = SendKind.SendMsg;//发送的消息
            msg.msgCommand = MsgCommand.SendToOne;//发送的是单用户信息
            msg.SID = sid;//发送ID
            msg.RID = revid;//接收ID
            msg.Data = data;//发送的信息
            msg.msgID = msgid;

            if (data.Length <= 1024)//如果发送信息的长度小于等于1024
            {
                msg.sendState = SendState.Single;
                //将信息直接发送给远程客户端
                udpsocket.Send(ip Convert.ToInt32(port) new ClassSerializers().SerializeBinary(msg).ToArray());
            }
            else
            {
                ClassMsg start = new ClassMsg();
                start.sendKind = SendKind.SendMsg;
                start.sendState = SendState.Start;//文件发送开始命令
                start.msgCommand = MsgCommand.SendToOne;//发送单用户命令
                start.SID = sid;
                start.RID = revid;
                start.Data = Encoding.Unicode.GetBytes(““);
                start.msgID = msgid;
                udpsocket.Send(ip Convert.ToInt32(port) new ClassSerializers().SerializeBinary(start).ToArray());
                MemoryStream stream = new MemoryStream(data);//将二进制流存储到内存流中
                int sendlen = 1024; //设置文件每块发送的长度
                long sunlen = (stream.Length);//整个文件的大小
                int offset = 0;//设置文件发送的起始位置
                while (sunlen > 0)  //分流发送
                {
                    sendlen = 1024;
                    if (sunlen <= sendlen)
                        sendlen = Convert.ToInt32(sunlen);
                    byte[] msgdata = new byte[sendlen];
                    stream.Read(msgdata offset sendlen);//读取要发送的字节块
                    msg.sendState = SendState.Sending;//发送状态为文件发送中
                    msg.Data = msgdata;
                    udpsocket.Send(ip Convert.ToInt32(port) new ClassSerializers().SerializeBinary(msg).T

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    1048576  2008-11-05 13:10  C#开发典型模块大全2-13\02\MyQQ\Database\db_MyQQData_Data.MDF

     文件    1048576  2008-11-05 13:10  C#开发典型模块大全2-13\02\MyQQ\Database\db_MyQQData_Log.LDF

     文件       1498  2007-12-04 21:02  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\0.bmp

     文件       1498  2007-12-05 14:02  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\1.bmp

     文件      13198  2007-12-17 14:14  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Chat.cs

     文件      28506  2007-12-17 14:14  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Chat.Designer.cs

     文件     111156  2007-12-17 14:14  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Chat.resx

     文件      19562  2008-08-25 17:59  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Client.cs

     文件       8955  2008-08-25 17:59  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Client.Designer.cs

     文件      49122  2008-08-25 17:59  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Client.resx

     文件       5441  2008-08-25 16:13  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Logon.cs

     文件       6969  2008-08-25 16:13  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Logon.Designer.cs

     文件     373599  2008-08-25 16:13  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_Logon.resx

     文件       3717  2007-12-17 09:04  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_SerSetup.cs

     文件       9839  2007-12-17 09:04  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_SerSetup.Designer.cs

     文件       6012  2007-12-17 09:04  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\F_SerSetup.resx

     文件       4744  2007-12-05 13:50  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\MyQQClient.csproj

     文件        472  2007-11-27 23:08  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\Program.cs

     文件       1168  2007-11-27 23:00  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\Properties\AssemblyInfo.cs

     文件       3328  2007-12-13 16:39  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\Properties\Resources.Designer.cs

     文件       6403  2007-12-04 22:42  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\Properties\Resources.resx

     文件       1106  2007-12-13 16:39  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\Properties\Settings.Designer.cs

     文件        249  2007-11-27 23:00  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient\Properties\Settings.settings

     文件       2569  2007-12-05 14:44  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient.sln

    ..A..H.     55808  2008-05-07 17:10  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQClient.suo

     文件      15426  2008-07-11 16:18  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQServer\F_Server.cs

     文件       8367  2008-06-27 18:16  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQServer\F_Server.Designer.cs

     文件       6407  2008-06-27 18:16  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQServer\F_Server.resx

     文件       4219  2007-12-04 23:55  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQServer\MyQQServer.csproj

     文件        472  2007-11-27 20:34  C#开发典型模块大全2-13\02\MyQQ\MyQQClient\Backup\MyQQServer\Program.cs

............此处省略760个文件信息

评论

共有 条评论