随笔分类 -  c#基础知识

c#异步文件传输功能
摘要:服务器端:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.Net.Sockets;using System.Threading;using System.Runtime.InteropServices;using System.IO;namespace RecvFileServer{ /// <summary> /// 本文件主要处理多文件传输,首先做单文件传输,然后做多文件进行传输,今天完成对多文件发送.今 阅读全文
posted @ 2013-05-20 11:02 RedLight 阅读(7317) 评论(0) 推荐(0)
c#读取文件,重新建立文件,把读取的数据放入到文件中去
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;namespace OperateFile{ //获取图片的数据,然后将数据存储到另一张图片中去。 class Program { static void Main(string[] args) { try { FileInfo fileInfo = new FileInfo("zh... 阅读全文
posted @ 2013-05-10 17:22 RedLight 阅读(358) 评论(0) 推荐(0)
c#中关于结构体和字节数组转化
摘要:最近在使用结构体与字节数组转化来实现socket间数据传输。现在开始整理一下。对于Marshal可以查阅msdn,关于字节数组与结构体转代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Runtime.InteropServices;namespace FileSendClient{ [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet... 阅读全文
posted @ 2013-04-26 15:43 RedLight 阅读(27533) 评论(3) 推荐(2)