欢迎来到天天文库
浏览记录
ID:9491474
大小:58.00 KB
页数:5页
时间:2018-05-01
《windows mobile上的gprs连接(基于tcpclient)》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
WindowsMobile上的GPRS连接(基于TcpClient) 在有线的连接和grApiReadyEvent(); mre.GR_PARAM_GUIDDEST; ci.d=0; if(ConnMgrEstablishConnectionSync(refci,refphConnection,INFINITE,refstatus)!=S_OK status!=CONNMGR_STATUS_CONNECTED) returnfalse; ht[urlStr]=phConnection; returntrue; } publicstaticboolRelease(Uriurl) { returnRelease(url.ToString()); } publicstaticboolRelease(stringurlStr) { returnRelease(urlStr,true); } privatestaticboolRelease(stringurlStr,boolremoveNode) { boolres=true; IntPtrph=IntPtr.Zero; if(ht[urlStr]==null) returntrue; ph=(IntPtr)ht[urlStr]; if(ConnMgrReleaseConnection(ph,1)!=S_OK) 12下一页——感谢阅读这篇文章,..,res=false; CloseHandle(ph); if(removeNode) ht.Remove(urlStr); returnres; } publicstaticvoidReleaseAll() { foreach(DictionaryEntrydeinht) { Release((string)de.Key,false); } ht.Clear(); } [StructLayout(LayoutKind.Sequential)] publicstructConnectionInfo { publicuintcbSize; publicuintds; publicuintd; publicuintulMaxCost; publicuintulMinRcvBport(cellcore.dll)] privatestaticexternintConnMgrMapURL(stringpport(cellcore.dll)] privatestaticexternintConnMgrEstablishConnectionSync(refConnectionInfoci,refIntPtrphConnection,uintdeout,refuintpdport(cellcore.dll)] privatestaticexternIntPtrConnMgrApiReadyEvent(); [DllImport(cellcore.dll)] privatestaticexternintConnMgrReleaseConnection(IntPtrhConnection,intbCache); [DllImport(coredll.dll)] privatestaticexternintCloseHandle(IntPtrhObject); } 使用GPRSConnectionclass的时候, 先调用Setup方法创建连接,见以下代码: publicvoidDoTcpConnection() { stringurl=.msn.; boolres=GPRSConnection.Setup(anthonywong/archive/2006/03/13/550686.aspx上一页12——感谢阅读这篇文章,..,
此文档下载收益归作者所有
举报原因
联系方式
详细说明
内容无法转码请点击此处