友情链接1:21点 足球投注 投注网 明升体育 hg0088 葡京赌场 网上赌球 诈金花 澳门金沙网址 澳门银河网址 澳门银河 澳门银河官网 银河官网 威尼斯人 澳门威尼斯人 澳门威尼斯人官网 威尼斯人官网 金沙 澳门金沙 澳门金沙官网 金沙官网 现金网 赌球网 全讯网 明升国际 足球开户 ******官网 ******网址 现金赌博 澳门现金网 ******官方网站

Symbol MC1000-灏忚瘯鐗涘垁 « Carey's Blog - 寤栧媷鐨勫崥瀹

Symbol MC1000-灏忚瘯鐗涘垁

鏃堕棿锛2012骞03鏈10鏃浣滆咃細Carey闃呰(5,520)璇勮(3)

鐜:
VS2008 .net3.5
Symbol MC1000 WinCE 500
锛1锛夎璇1锛歁C1000杩炵數鑴戜笉闇瑕侀┍鍔紝鍙渶瑕佸井杞殑Microsoft ActiveSync銆傝繖涓ソ鎵撅紝鍒板井杞畼缃戜笅灏卞ソ銆傚畨瑁呭ソ鍚庯紝鐐瑰嚮鏂囦欢-杩炴帴璁剧疆-杩炴帴銆傝鍏堟墦寮Microsoft ActiveSync锛岀劧鍚庡啀鎻掍笂MC1000鍒板簳搴т笂锛岀郴缁熶細鑷姩杩炴帴銆傝繛鎺ュソ鍚庣偣鍑绘祻瑙堝彲浠ョ湅鍒伴噷闈㈢殑鏂囦欢缁撴瀯銆
锛2锛夎璇2锛氭壂鎻忔潯鐮佽鑷繁缂栫▼锛屾湰浠ヤ负閲岄潰浼氭湁杩欎釜鍔熻兘锛屾壂鎻忎笅锛岀劧鍚庝竴璧锋妸鏁版嵁璇诲嚭鏉ワ紝缁撴灉鍙戠幇娌℃湁锛岄噷闈㈤檮甯︾殑涓涓粈涔堢▼搴忥紙鍚庤鎴戝垹闄わ級锛屽彧鏄壂涓涓潯鐮侊紝澶勭悊璇佹槑鏉$爜鎵弿鍙互浣跨敤锛屾病鏈夊叾瀹冧环鍊笺
锛3锛夎璇3锛氶渶瑕佸湪鏈哄櫒涓婂畨瑁匩ETCFv35鍜宻ymbol.all.arm.cab涓涓畨瑁呭寘锛岀劧鍚庡鍒跺啓濂界殑绋嬪簭銆侼ETCFv35鍦–:Program FilesMicrosoft.NETSDKCompactFrameworkv3.5WindowsCE涓紝瀹夎VS浼氳嚜鍔ㄦ湁锛宻ymbol.all.arm.cab鍦–:Program FilesMotorola EMDK for .NETv2.3SDKSmart Deviceswce500armv4i涓紝瀹夎EMDK灏变細鏈夈傚鍒跺埌Application鐩綍涓嬮潰锛岀劧鍚庡畨瑁呫
锛4锛夎璇4锛氱敤VS2008寮鍙戠▼搴忥紝鏂板缓涓涓」鐩紝椤圭洰绫诲瀷閫夋嫨鏅鸿兘璁惧-鏅鸿兘璁惧椤圭洰锛岄」鐩睘鎬э細璁惧鐨勬椂鍊欐妸閮ㄧ讲.Net Compact Framework鍕鹃夊幓鎺夛紝鍥犱负鎴戜滑涔嬪墠宸茬粡瀹夎浜嗐傜収鐫甯姪鍐欎釜绋嬪簭锛岄儴缃插氨鍙互浜嗐

浣跨敤RAPI搴撴搷浣滅Щ鍔ㄨ澶団斺擟#璇█鎻忚堪

[DllImport("rapi.dll", CharSet = CharSet.Unicode)]
        internal static extern int CeRapiGetError();
        [DllImport("rapi.dll", CharSet = CharSet.Unicode)]
        internal static extern int CeRapiInit();
        [DllImport("rapi.dll", CharSet = CharSet.Unicode)]
        internal static extern int CeCloseHandle(IntPtr hObject);
        [DllImport("rapi.dll", CharSet = CharSet.Unicode)]
        internal static extern int CeWriteFile(IntPtr hFile, byte[] lpBuffer,
            int nNumberOfbytesToWrite, ref int lpNumberOfbytesWritten, int lpOverlapped);
        [DllImport("rapi.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        internal static extern IntPtr CeCreateFile(
            string lpFileName,
            uint dwDesiredAccess,
            int dwShareMode,
            int lpSecurityAttributes,
            int dwCreationDisposition,
            int dwFlagsAndAttributes,
            int hTemplateFile);
        [DllImport("rapi.dll", CharSet = CharSet.Unicode)]
        internal static extern int CeRapiUninit();

聽鍏抽敭浠g爜濡備笅:

string path = Directory.GetCurrentDirectory() + "[url=file://db.txt]db.txt[/url]";
            if (File.Exists(path))
            {
                File.Delete(path);//鍏堝垹闄よ浠庤澶囦笂澶嶅埗杩囨潵鐩綍鐨勬枃浠
            }
            PDA pda = new PDA();
            if (RapiInit())//鍒濆鍖栦笌璁惧杩炴帴
                pda.CopyFileFromDevice("db.txt", "db.txt", false);
            int ret=pda.CeDeleteFiles("db.txt");
            RAPIUninit();//鍏抽棴杩炴帴
            InitFrom("db.txt");
            if (ret != 1)
            {
                MessageBox.Show("杩滅▼璁惧鏂囦欢鍒犻櫎澶辫触,浼氬紩璧峰悗鏈熸搷浣滃け璐.璇疯仈绯荤郴缁熺鐞嗗憳!", "鎿嶄綔鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

//鍒濆鍖栦笌璁惧鐨勮繛鎺
        public bool RapiInit()
        {
            int ret = CeRapiInit();
            if (ret != 0)
            {
                // 杩炴帴澶辫触锛岃幏鍙栧け璐ヤ唬鐮
                int e = CeRapiGetError();
                // 鎶涘嚭寮傚父
                MessageBox.Show("璁惧杩炴帴澶辫触,璇锋鏌ユ帴鍙f槸鍚︾晠閫!閿欒浠g爜:" + ret.ToString());
                return false;
            }
            return true;
        }
        //鏂紑RAPI杩炴帴
        public void RAPIUninit()
        {
            CeRapiUninit();
        }
        private void InitFrom(string sPath)
        {
            //璇诲彇鏂囦欢
            if (!File.Exists(sPath))
            {
                return;
            }
            FileStream fss = new FileStream(sPath, FileMode.Open);
            StreamReader sr = new StreamReader(fss);
            string fileStr = "";
            DataTable dat = new DataTable();
            DataColumn BillId2 = new DataColumn("BillId", typeof(System.String));   //鎵规鍙
            DataRow Row;
            bool isEnd = true;
            while (!sr.EndOfStream)
            {
                if (isEnd)
                {
                    dat.Columns.Add(BillId2);
                    isEnd = false;
                }
                fileStr = sr.ReadLine();
                string[] strAnrry = fileStr.Split(';');
                if (strAnrry[0].ToString() == "1")
                {
                    Row = dat.NewRow();
                    Row["BillId"] = strAnrry[1].ToString();
                    dat.Rows.Add(Row);
                }
            } 

        }
PDA绫:
public class PDA
    {
        [DllImport("rapi.dll ", CharSet = CharSet.Unicode, SetLastError = true)]
        internal static extern int CeDeleteFile(string lpFileName);//鍒犻櫎璁惧鏂囦欢
        [DllImport("rapi.dll ", CharSet = CharSet.Unicode, SetLastError = true)]
        internal static extern IntPtr CeCreateFile(
                string lpFileName,
                uint dwDesiredAccess,
                int dwShareMode,
                int lpSecurityAttributes,
                int dwCreationDisposition,
                int dwFlagsAndAttributes,
                int hTemplateFile);
        [DllImport("rapi.dll ", CharSet = CharSet.Unicode, SetLastError = true)]
        internal static extern int CeReadFile(IntPtr hFile, byte[] lpBuffer, int nNumberOfbytesToRead, ref   int lpNumberOfbytesRead, int lpOverlapped);
        [DllImport("rapi.dll ", CharSet = CharSet.Unicode)]
        internal static extern int CeCloseHandle(IntPtr hObject);
        private const short CREATE_NEW = 1;
        private const short CREATE_ALWAYS = 2;
        private const uint GENERIC_WRITE = 0x40000000;
        private const uint GENERIC_READ = 0x80000000;
        private const short OPEN_EXISTING = 3;
        private const short FILE_ATTRIBUTE_NORMAL = 0x80;
        internal const int ERROR_NO_MORE_FILES = 18;
        private const short INVALID_HANDLE_VALUE = -1;
        public const string UploadPath = "C:FPGMaterialUPLOAD ";
        /// <summary>
        /// 鍒犻櫎璁惧鏂囦欢
        /// </summary>
        /// <param name="filName">鏂囦欢鍚</param>
        /// <returns>1--鎴愬姛</returns>
        public int CeDeleteFiles(string filName)
        {
            int ret = CeDeleteFile(filName);
            return ret;
        }
        //灏囬仩绋嬭ō鍌欎笂鐨勬枃浠惰瑁藉埌PCs鏂囦欢鐩寗涓
        public void CopyFileFromDevice(string LocalFileName, string RemoteFileName, bool Overwrite)
        {
            FileStream localFile;
            IntPtr remoteFile = IntPtr.Zero;
            int bytesread = 0;
            int create = Overwrite ? CREATE_ALWAYS : CREATE_NEW;
            byte[] buffer = new byte[0x1000];   //   4k   transfer   buffer
            //   open   the   remote   (device)   file
            remoteFile = CeCreateFile(RemoteFileName, GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
            //   check   for   success
            if ((int)remoteFile == INVALID_HANDLE_VALUE)
            {
                throw new Exception("涓嶈兘鎵撳紑杩滅▼璁惧涓婄殑鏂囨湰鏂囦欢");
            }
            //   create   the   local   file
            localFile = new FileStream(LocalFileName, Overwrite ? FileMode.Create : FileMode.CreateNew, FileAccess.Write);
            //   read   data   from   remote   file   into   buffer
            CeReadFile(remoteFile, buffer, 0x1000, ref   bytesread, 0);
            while (bytesread > 0)
            {
                //   write   it   into   local   file
                localFile.Write(buffer, 0, bytesread);
                //   get   more   data
                if (!Convert.ToBoolean(CeReadFile(remoteFile, buffer, 0x1000, ref   bytesread, 0)))
                {
                    CeCloseHandle(remoteFile);
                    localFile.Close();
                    throw new Exception("璇诲彇杩滅▼璁惧涓婄殑鏂囨湰鏂囦欢澶辨晽! ");
                }
            }
            //   close   the   remote   file
            CeCloseHandle(remoteFile);
            localFile.Flush();
            //   close   the   local   file
            localFile.Close();
        } 

    }

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Carey's Blog
杞浇璇锋敞鏄庤浆鑷Symbol MC1000-灏忚瘯鐗涘垁

鏍囩锛鍒嗙被锛.NET缂栫▼, WinCE寮鍙
3鏉¤瘎璁
  1. Jessica鐣欒█浜:2012骞08鏈16鏃04:04

    Play informative for me, Mr. inertnet writer.

  2. BlueHost鐣欒█浜:2012骞11鏈11鏃08:16

    鍐欑殑寰堜笉閿欙紝瀛︿範浜嗐

  3. Pharmg759鐣欒█浜:2013骞02鏈04鏃16:51

    Hello! dafgcge interesting dafgcge site! I’m really like it! Very, very dafgcge good!

姝ゆ棩蹇楀凡鍏抽棴璇勮锛