• 大小: 103KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: 其他
  • 标签: SOCKET  c#  QQ  模拟  程序  

资源简介

这是一个基于SOCKET编写的QQ模拟程序,能实现QQ本地登录、聊天、传文件、传图片等功能。

资源截图

代码片段和文件信息

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

namespace QQclient
{
    public partial class Form1 : Form
    {
        System.Threading.Thread t;
        public string DFIP;
        public Form1()
        {
            System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
        }

        private void splitContainer1_Panel2_Paint(object sender PaintEventArgs e)
        {

        }

        private void splitContainer1_Panel1_Paint(object sender PaintEventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender EventArgs e)
        {

        }



        private void textBox1_TextChanged(object sender EventArgs e)
        {

        }

        private void Form1_Load(object sender EventArgs e)
        {
            Thread T1 = new Thread(new ThreadStart(this.CL));
            T1.Start();
            Thread T2 = new Thread(new ThreadStart(this.fy));
            T2.Start();
            Thread T3 = new Thread(new ThreadStart(this.CT));
            T3.Start();
        }
        private void fy()
        {
            TcpListener Listener = new TcpListener(IPAddress.Parse(“127.0.0.1“) 50000);
            Listener.Start();
            while (true)
            {
                Socket S = Listener.AcceptSocket();
                NetworkStream NS = new NetworkStream(S);
                StreamReader SR = new StreamReader(NS System.Text.Encoding.Unicode);
                String X = SR.ReadLine();
                this.textBox2.Text += “服务器端:“ + X + “\r\n“;
            }
        }
        private void CL()
        {
            TcpListener L = new TcpListener(IPAddress.Parse(“127.0.0.1“) 62000);
            L.Start();
            while (true)
            {
                Socket S = L.AcceptSocket();
                byte[] sender = new byte[30000];
                int count = S.Receive(sender 30000 SocketFlags.None);
                bool sfwjm = false;
                string fn2 = ““;
                int x = 0;
                for (int i = 0; i < sender.Length; i++)
                {
                    if (sender[i] == ‘#‘)
                    {
                        x = i;
                        break;
                    }
                    if (sfwjm == true)
                    {
                        fn2 += Convert.ToChar(sender[i]).ToString();
                    }
                    if (sender[i] == ‘$‘)
                    {
                        sfwjm = true;
                    }
                }
                this.saveFileDialog1.Filter = “文件|*.“ + fn2.Substring(fn2.Length - 3);
                this.saveFileDialog1.ShowDialog();
                s

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

     文件      32768  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\bin\Debug\QQclient.exe

     文件      40448  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\bin\Debug\QQclient.pdb

     文件       5632  2005-12-08 14:51  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\bin\Debug\QQclient.vshost.exe

     文件      11045  2010-06-07 16:47  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Form1.cs

     文件       7580  2010-06-07 16:47  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Form1.Designer.cs

     文件       6624  2010-06-07 16:47  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Form1.resx

     文件       2464  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Form2.cs

     文件       5661  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Form2.Designer.cs

     文件      12754  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Form2.resx

     文件        900  2010-07-01 00:04  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\Debug\QQclient.csproj.GenerateResource.Cache

     文件      32768  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\Debug\QQclient.exe

     文件        180  2010-06-07 16:47  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\Debug\QQclient.Form1.resources

     文件       4767  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\Debug\QQclient.Form2.resources

     文件      40448  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\Debug\QQclient.pdb

     文件        180  2010-06-07 16:41  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\Debug\QQclient.Properties.Resources.resources

     文件        311  2010-07-01 00:05  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\QQclient.csproj.FileList.txt

     文件       2501  2010-06-07 16:54  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\obj\QQclient.csproj.FileListAbsolute.txt

     文件        467  2004-01-01 08:31  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Program.cs

     文件       1178  2010-04-07 15:51  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Properties\AssemblyInfo.cs

     文件       2872  2010-04-07 15:51  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Properties\Resources.Designer.cs

     文件       5612  2010-04-07 15:51  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Properties\Resources.resx

     文件       1093  2010-04-07 15:51  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Properties\Settings.Designer.cs

     文件        249  2010-04-07 15:51  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\Properties\Settings.settings

     文件       3562  2010-05-03 22:04  基于SOCKET编写的QQ模拟程序\QQclient\QQclient\QQclient.csproj

     文件        913  2010-04-07 15:51  基于SOCKET编写的QQ模拟程序\QQclient\QQclient.sln

    ..A..H.     20480  2010-07-01 00:06  基于SOCKET编写的QQ模拟程序\QQclient\QQclient.suo

     文件      24576  2010-06-07 16:47  基于SOCKET编写的QQ模拟程序\QQserver\QQserver\bin\Debug\QQserver.exe

     文件      30208  2010-06-07 16:47  基于SOCKET编写的QQ模拟程序\QQserver\QQserver\bin\Debug\QQserver.pdb

     文件       5632  2005-12-08 14:51  基于SOCKET编写的QQ模拟程序\QQserver\QQserver\bin\Debug\QQserver.vshost.exe

     文件       9415  2010-06-07 16:47  基于SOCKET编写的QQ模拟程序\QQserver\QQserver\Form1.cs

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

评论

共有 条评论