http://bbs.csdn.net/topics/390460167
看到这么好的帖子,竟然是 WinCE 下 FTP 的实现,但却发在 .NET技术 > C# 区,相信部分 CE 的爱好者不一定能看到,所以转到 CE 的坛子。
多谢 zhouzhangkui 开源出来!
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;<br>
namespace SimpleFtp
{
internal class WinAPI
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class WIN32_FIND_DATA
{
public UInt32 dwFileAttributes = 0;
public FILETIME ftCreationTime;
public FILETIME ftLastAccessTime;
public FILETIME ftLastWriteTime;
public UInt32 nFileSizeHigh = 0;
public UInt32 nFileSizeLow = 0;
public UInt32 dwReserved0 = 0;
public UInt32 dwReserved1 = 0;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string cFileName = null;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
public string cAlternateFileName = null;
};
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class FILETIME
{
public int dwLowDateTime = 0;
public int dwHighDateTime = 0;
};<br>
public const int INTERNET_FLAG_PASSIVE = 0x8000000; //被动模式
public const int INTERNET_FLAG_PORT = 0x0; //主动模式<br>
public const uint INTERNET_FLAG_RELOAD = 0x80000000; //
public const uint INTERNET_FLAG_KEEP_CONNECTION = 0x400000; //
public const uint INTERNET_FLAG_MULTIPART = 0x200000; //<br>
public const int INTERNET_OPEN_TYPE_PRECONFIG = 0;