资源简介

实现文件上传和下载,包含服务器和客户端

对于学习TCP的同学有帮助

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.Remoting;
using System.IO;
using System.Threading;
namespace Client
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
            OpenUrl();
}
long CountLen = 0;
long Len = 0;
Remoteobject.Myobject app;
public void Upload(string filename)
{
if(filename==““)
{
MessageBox.Show(“请选择要上传的文件!““提示“);
return;
}
if(!File.Exists(filename))
{
MessageBox.Show(“上传的文件不存在!““错误“);
return;
}
FileStream fs = new FileStream(filename

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

     文件      28672  2009-07-29 16:37  Remoteobject\Client\bin\Debug\Client.exe

     文件      36352  2009-07-29 16:37  Remoteobject\Client\bin\Debug\Client.pdb

     文件       5632  2005-12-08 14:51  Remoteobject\Client\bin\Debug\Client.vshost.exe

     文件      16384  2009-07-29 16:33  Remoteobject\Client\bin\Debug\Remoteobject.dll

     文件      13824  2009-07-29 16:33  Remoteobject\Client\bin\Debug\Remoteobject.pdb

     文件       3777  2009-07-29 16:25  Remoteobject\Client\Client.csproj

     文件       6880  2009-07-29 16:37  Remoteobject\Client\Form1.cs

     文件      13154  2009-07-29 16:36  Remoteobject\Client\Form1.Designer.cs

     文件       6627  2009-07-29 16:36  Remoteobject\Client\Form1.resx

     文件        329  2009-07-29 16:28  Remoteobject\Client\Help.cs

     文件       2312  2009-07-29 16:28  Remoteobject\Client\Help.Designer.cs

     文件       6551  2009-07-29 16:28  Remoteobject\Client\Help.resx

     文件        823  2009-07-29 16:40  Remoteobject\Client\obj\Client.csproj.FileListAbsolute.txt

     文件        899  2009-07-29 16:36  Remoteobject\Client\obj\Debug\Client.csproj.GenerateResource.Cache

     文件      28672  2009-07-29 16:37  Remoteobject\Client\obj\Debug\Client.exe

     文件        180  2009-07-29 16:36  Remoteobject\Client\obj\Debug\Client.Form1.resources

     文件        879  2009-07-29 16:33  Remoteobject\Client\obj\Debug\Client.Help.resources

     文件      36352  2009-07-29 16:37  Remoteobject\Client\obj\Debug\Client.pdb

     文件        180  2009-07-29 16:33  Remoteobject\Client\obj\Debug\Client.Properties.Resources.resources

     文件       2570  2009-07-29 16:33  Remoteobject\Client\obj\Debug\ResolveAssemblyReference.cache

     文件        465  2009-06-25 14:27  Remoteobject\Client\Program.cs

     文件       1160  2009-06-25 14:27  Remoteobject\Client\Properties\AssemblyInfo.cs

     文件       2868  2009-06-25 14:27  Remoteobject\Client\Properties\Resources.Designer.cs

     文件       5612  2009-06-25 14:27  Remoteobject\Client\Properties\Resources.resx

     文件       1091  2009-06-25 14:27  Remoteobject\Client\Properties\Settings.Designer.cs

     文件        249  2009-06-25 14:27  Remoteobject\Client\Properties\Settings.settings

     文件      16384  2009-07-29 16:33  Remoteobject\Remoteobject\bin\Debug\Remoteobject.dll

     文件      13824  2009-07-29 16:33  Remoteobject\Remoteobject\bin\Debug\Remoteobject.pdb

     文件       4340  2009-07-16 11:44  Remoteobject\Remoteobject\Myobject.cs

     文件      16384  2009-07-29 16:33  Remoteobject\Remoteobject\obj\Debug\Remoteobject.dll

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

评论

共有 条评论