⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defcmd.cs

📁 自定义协议
💻 CS
字号:
using System;
using System.IO;


namespace CodeManagerService
{

	public class defcmd
	{

		/// <summary>
		/// 版本号
		/// </summary>
		public const byte		Version			= 0x10;


		/// <summary>
		/// 代码管理服务HOME
		/// </summary>
		public const String		CMS_HOME		= "d:\\cms";

		/// <summary>
		/// define cmd
		/// </summary>
		public const int		FLALL			= 0x00000001;	
		public const int		MKD				= 0x00000002;	
		public const int		RMD				= 0x00000003;	
		public const int		CWD				= 0x00000004;	
		public const int		RND				= 0x00000005;	
		public const int		PWD				= 0x00000006;	
		public const int		DELE			= 0x00000007;	
		public const int		UPF				= 0x00000008;	
		public const int		DOF				= 0x00000009;	
		public const int		RNF				= 0x00000010;
		public const int		ACTIION_TEST	= 0x10000001;	
		public const int		CONNECT			= 0x10000002;	
		public const int		UPF_BODY		= 0x10000004;		//上传文件体
		public const int 		DOF_BODY		= 0x10000005;		//下载文件体

		/// <summary>
		/// define error
		/// </summary>
		public const int		OK				= 0x00000000;
		public const int		UNKNOWERROR		= 0x20000000;
		public const int		NOTCONNECT		= 0x20000001;	
		public const int		FDLISTERROR		= 0x20000002;	
		public const int		MKDERROR		= 0x20000003;
		public const int		MKDEXISTS		= 0x20000004;
		public const int		CWDNOTEXISTS	= 0x20000005;
		public const int		RMDERROR		= 0x20000006;
		public const int		RNDERROR		= 0x20000007;
		public const int		DELEERROR		= 0x20000008;
		public const int		UPFERROR		= 0x20000009;
		public const int		RNFERROR		= 0x20000010;
		public const int		CPWD			= 0x20000011;



		/// <summary>
		/// 函数定义
		/// </summary>
		public static byte [] b2b(byte [] Value, int index, int len)
		{
			byte [] bTmp = new byte[len];
			for (int i = 0; i < len; i++)
				bTmp[i] = Value[i+index];
			return bTmp;
		}


		public static int b2int(byte [] Value)
		{
			int iTmp = Value[3];
			iTmp = (iTmp << 8) | Value[2];
			iTmp = (iTmp << 8) | Value[1];
			iTmp = (iTmp << 8) | Value[0];

			return iTmp;
		}

		public static byte [] int2b(int Value)
		{
			byte [] bTmp = new byte[4];
			bTmp[3] = (byte)((Value >> 24) & 0xff);
			bTmp[2] = (byte)((Value >> 16) & 0xff);
			bTmp[1] = (byte)((Value >> 8) & 0xff);
			bTmp[0] = (byte)(Value & 0xff);
			
			return bTmp;
		}

	}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -