随笔分类 - 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> /// 本文件主要处理多文件传输,首先做单文件传输,然后做多文件进行传输,今天完成对多文件发送.今
阅读全文
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...
阅读全文
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...
阅读全文
浙公网安备 33010602011771号