• 大小: 1.38MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-28
  • 语言: C#
  • 标签: 聊天程序  

资源简介

基于C#的网络聊天程序,使用关键技术有socket的网络编程,以及图片二进制流的转换

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 数据库;
using System.Data.OleDb;
using System.IO;
namespace 主界面
{
    public class jiemian
    {
     
        
        public void tupianxieru()
        {   
            string mysql= “insert into 用户头像表(账号图片) values(‘201516080121‘@picture)“;
            FileStream filestream = new FileStream(@“D:\shixun\3.jpg“ FileMode.Open);
            byte[] bfile1 = new byte[filestream.Length];
            filestream.Read(bfile1 0 (int)filestream.Length);
            filestream.Close();
            shujuku shujuku1 = new shujuku();
            OleDbConnection myconn = shujuku1.lianjieshujuku();
            OleDbCommand com = new OleDbCommand(mysql myconn);
            com.Parameters.AddWithValue(“@picture“ bfile1);
            com.ExecuteNonQuery();
            string mysql1= “insert into 用户头像表(账号图片) values(‘201516080122‘@picture)“;
            FileStream filestream1 = new FileStream(@“D:\shixun\1.jpg“ FileMode.Open);
            byte[] bfile2 = new byte[filestream1.Length];
            filestream1.Read(bfile2 0 (int)filestream1.Length);
            filestream1.Close();
            OleDbCommand com1 = new OleDbCommand(mysql1 myconn);
            com1.Parameters.AddWithValue(“@picture“ bfile2);
            com1.ExecuteNonQuery();
            string mysql2 = “insert into 用户头像表(账号图片) values(‘201516080120‘@picture)“;
            FileStream filestream2 = new FileStream(@“D:\shixun\2.jpg“ FileMode.Open);
            byte[] bfile3 = new byte[filestream2.Length];
            filestream2.Read(bfile3 0 (int)filestream2.Length);
            filestream2.Close();
            OleDbCommand com2 = new OleDbCommand(mysql2 myconn);
            com2.Parameters.AddWithValue(“@picture“ bfile3);
            com2.ExecuteNonQuery();
            string mysql3 = “insert into 用户头像表(账号图片) values(‘201516080123‘@picture)“;
            FileStream filestream3 = new FileStream(@“C:\Users\hasee\Desktop\shixun\3.jpg“ FileMode.Open);
            byte[] bfile4= new byte[filestream3.Length];
            filestream3.Read(bfile4 0 (int)filestream3.Length);
            filestream3.Close();
            OleDbCommand com3 = new OleDbCommand(mysql3 myconn);
            com3.Parameters.AddWithValue(“@picture“ bfile4);
            com3.ExecuteNonQuery();
            myconn.Close();
        }
        public void zengjia()
        { 
            
        }

    }
}

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

    I.A....    245103  2017-06-26 16:10  jianyuebaisexiantiaochouxiangbeijing_5266300.jpg

    I.A....     14871  2017-06-29 22:48  QQ图片20170629224843.png

    I.A....     12010  2017-06-20 16:20  timg.jpg

    I.A....      8921  2017-06-12 14:07  timgCASTN9K3.jpg

    I.A....    380928  2018-04-14 23:01  Database1.accdb

    I.A....    806912  2018-05-30 23:58  Database1_be.accdb

    I.A....     36383  2017-06-20 16:20  2.jpg

    I.A....     19722  2017-06-20 16:21  3.jpg

    I.A....    148737  2017-06-26 16:19  6b9813a227ad513d06c6f83a370173ab.jpg

    I.A....    127843  2017-06-26 16:15  0975.jpg_wh1200.jpg

    I.A....     15202  2017-06-20 16:20  1.jpg

    I.A....      6144  2018-05-30 23:56  聊天程序\待定\bin\Debug\待定.dll

    I.A....     13824  2018-05-30 23:56  聊天程序\待定\bin\Debug\待定.pdb

    I.A....      4608  2018-04-14 23:01  聊天程序\待定\bin\Debug\数据库.dll

    I.A....     11776  2018-04-14 23:01  聊天程序\待定\bin\Debug\数据库.pdb

    I.A....      2713  2018-05-30 23:56  聊天程序\待定\jiemian.cs

    I.A....      6545  2018-04-14 22:38  聊天程序\待定\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

    I.A....         0  2017-06-12 22:31  聊天程序\待定\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

    I.A....         0  2017-06-12 22:31  聊天程序\待定\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

    I.A....         0  2017-06-12 22:31  聊天程序\待定\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

    I.A....      2079  2018-04-14 22:51  聊天程序\待定\obj\Debug\主界面.csproj.FileListAbsolute.txt

    I.A....      5619  2018-04-14 23:01  聊天程序\待定\obj\Debug\主界面.csprojResolveAssemblyReference.cache

    I.A....       559  2017-06-21 14:34  聊天程序\待定\obj\Debug\主界面功能.csproj.FileListAbsolute.txt

    I.A....      5661  2017-06-21 14:34  聊天程序\待定\obj\Debug\主界面功能.csprojResolveAssemblyReference.cache

    I.A....      6144  2018-05-30 23:56  聊天程序\待定\obj\Debug\待定.dll

    I.A....     13824  2018-05-30 23:56  聊天程序\待定\obj\Debug\待定.pdb

    I.A....      1332  2017-06-12 22:31  聊天程序\待定\Properties\AssemblyInfo.cs

    I.A....      2616  2017-06-21 00:13  聊天程序\待定\主界面.csproj

    I.A....      4096  2018-04-14 22:51  聊天程序\待定2\bin\Debug\待定2.dll

    I.A....      7680  2018-04-14 22:51  聊天程序\待定2\bin\Debug\待定2.pdb

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

评论

共有 条评论