资源简介
Socket文件传输源码,实现了 服务端向客户端 发送文件 功能
功能介绍:
使用socket实现文件传输同时使用了多线程,
首先服务端选择文件,开始监听启动客户端,选
择连接就实现了文件的传输。
注意:
不同机器连接要修改源代码的的ip地址。
开发环境为Visual Studio 2010
代码片段和文件信息
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.IO;
using System.Threading;
using System.Net.Sockets;
using System.Net;
namespace FileClient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//_5_1_a_s_p_x
//连接
private void btnConnect_Click(object sender EventArgs e)
{
Thread mythread = new Thread(GetData);
mythread.Start();
}
//接受数据
private void GetData()
{
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(“127.0.0.1“) 8080);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 256 2014-01-13 07:16 源码必读.txt
....... 9728 2012-07-31 10:10 FileClient\bin\Debug\FileClient.exe
....... 30208 2012-07-31 10:10 FileClient\bin\Debug\FileClient.pdb
....... 11600 2012-07-31 10:10 FileClient\bin\Debug\FileClient.vshost.exe
....... 490 2012-07-31 10:10 FileClient\bin\Debug\FileClient.vshost.exe.manifest
....... 3679 2012-07-31 10:10 FileClient\FileClient.csproj
....... 227 2012-07-31 10:10 FileClient\FileClient.csproj.user
....... 3508 2012-07-31 10:10 FileClient\Form1.cs
....... 2632 2012-07-31 10:10 FileClient\Form1.Designer.cs
....... 5817 2012-07-31 10:10 FileClient\Form1.resx
....... 6232 2012-07-31 10:10 FileClient\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
....... 1634 2012-07-31 10:10 FileClient\obj\x86\Debug\FileClient.csproj.FileListAbsolute.txt
....... 9728 2012-07-31 10:10 FileClient\obj\x86\Debug\FileClient.exe
....... 180 2012-07-31 10:10 FileClient\obj\x86\Debug\FileClient.Form1.resources
....... 30208 2012-07-31 10:10 FileClient\obj\x86\Debug\FileClient.pdb
....... 180 2012-07-31 10:10 FileClient\obj\x86\Debug\FileClient.Properties.Resources.resources
....... 470 2012-07-31 10:10 FileClient\obj\x86\Debug\GenerateResource.read.1.tlog
....... 1162 2012-07-31 10:10 FileClient\obj\x86\Debug\GenerateResource.write.1.tlog
....... 506 2012-07-31 10:10 FileClient\Program.cs
....... 1370 2012-07-31 10:10 FileClient\Properties\AssemblyInfo.cs
....... 2870 2012-07-31 10:10 FileClient\Properties\Resources.Designer.cs
....... 5612 2012-07-31 10:10 FileClient\Properties\Resources.resx
....... 1095 2012-07-31 10:10 FileClient\Properties\Settings.Designer.cs
....... 249 2012-07-31 10:10 FileClient\Properties\Settings.settings
....... 13312 2012-07-31 10:10 FileServer\bin\Debug\FileServer.exe
....... 30208 2012-07-31 10:10 FileServer\bin\Debug\FileServer.pdb
....... 11600 2012-07-31 10:10 FileServer\bin\Debug\FileServer.vshost.exe
....... 490 2012-07-31 10:10 FileServer\bin\Debug\FileServer.vshost.exe.manifest
....... 3679 2012-07-31 10:10 FileServer\FileServer.csproj
....... 227 2012-07-31 10:10 FileServer\FileServer.csproj.user
............此处省略35个文件信息
- 上一篇:C#版 录音软件源码(亲测通过)
- 下一篇:电脑摄像头实时动态扫描读取二维码
相关资源
- c#入门经典 第七版 中文版 非扫描版
- .netc#新手菜鸟mvc5的仓库管理系统 so
- C# NPOI生成word插入图片和表格
- C#程序设计基础C#程序设计及应用教程
- 深入.NET平台和C#编程
- .net 美萍超市管理系统源码C#
- WinForm GeckoFx33 Demo JS与C#互交 窗口浏览
- 《ASP.NET程序设计项目教程》周虎,王
- 计算机图形学 三维模型处理算法初步
- C# KTV 点歌系统,C#项目源码带数据库
- C#实验--A.1 视频动态绘制练习.
- c#实现动态规划法——求解矩阵连乘问
- c#winform中完美代替WebBrowser最新的控件
- C#高级编程第9版:C#5.0 & .NET 4.5.1 par
- gmap离线地图执行文件
- Illustrated C# 2010 C# 4.0图解教程
- C# WINFORM框架源碼
- C# WinForm实践开发教程清晰版
- 3D打印机上位机源码Reprap Host 是C#写的
- C#设计模式+源码JamesW.Cooper.zip
- C#程序开发范例宝典(第3版).(配套
- C#写的年会抽奖软件包含源代码.zip
- 大型ERP C#源码
- asp.net完整项目带数据库
- 清大出版社 段德亮 《C#课程设计案例
- C#人事管理系统/人力资源管理系统
- C# 7 and .NET Core: Modern Cross-Platform Deve
- C# 5.0 in a Nutshell 5th Edition.pdf
-
C# 6.0 and the .NET 4.6 fr
amework(7th). - C# .NET webservices简单使用
评论
共有 条评论