Time of Update: 2018-12-05
這幾天在搞wm上面的gps 想擷取到衛星資料 找了些資料 大概的就是這兩種方式:一,傳統的gps編程方式 通過串口讀取到gps裝置的資料,解析,處理二,應用windows mobile 提供的gpsid函數庫下面試 gps傳統編程1 串口通訊,首先開啟gps裝置的port並接收資料命名空間using System;using System.Drawing;using System.Collections;using System.ComponentModel;using
Time of Update: 2018-12-05
ManualResetEvent是C#中一個比較常用的工具,可用於線程間通訊,實現一種類似訊號量的功能(不知道我這樣描述是否恰當,有可能不是“類似”,而“就是”通過訊號量來實現的,因為我也是最近才知道這個類,以前一直不知道,哈哈。如果有哪位清楚的話,請給我解惑。)。先瞭解一下ManualResetEvent的基本用法:1、初始化:public ManualResetEvent(bool initialState); ManualResetEvent的構造方法有個bool型參數,當為true時,
Time of Update: 2018-12-05
這個日誌還是挺有用的,有什麼想不起來的過來翻翻挺好,以後多多記錄。C#簡單的多線程以前用過,但是現在感覺好陌生。。。今天又查了查,趕緊記錄一下。private void LayoutRoot_SizeChanged(object sender, SizeChangedEventArgs e){ //使用object傳遞參數 Thread loadmap = new Thread(new ParameterizedThreadStart(LoadMapAsync));
Time of Update: 2018-12-05
//Having read code for a long time, finally i get it written down, and it doesn't seem that hard, you can do it!! #include "apue.h"#include <dirent.h>#include <limits.h> #ifdef PATH_MAXstatic int pathmax = PATH_MAX;#elsestatic
Time of Update: 2018-12-05
引用:通過Com 引用 Microsoft Excel 5.0 對象程式庫,引用後 bin 檔案夾中會出現 Interop.Excel.dll ,Microsoft.Vbe.Interop.dll , Office.dll 三個檔案。//=====================ExcelHelper(套用模板輸出Excel,並對資料進行分頁)==============using System;using System.IO;using System.Data;using
Time of Update: 2018-12-05
轉自:http://www.cnblogs.com/CUCmehp/archive/2009/01/12/1374320.htmlC++函數後面後加到關鍵字throw(something)限制,是對這個函數的異常安全性作出限制。void f() throw() 表示f不允許拋出任何異常,即f是異常安全的。void f() throw(...) 表示f可以拋出任何形式的異常。void f() throw(exceptionType);
Time of Update: 2018-12-05
[轉載:http://www.wangchao.net.cn/bbsdetail_49096.html] 在C++/CLI中如何讓你的Managed Code和Unmanaged(Native) Code溝通自如?interior_ptr和pin_ptr是橋樑——interior_ptr充當一個Managed Heap上的Native Pointer的角色。而pin_ptr則可以把對象釘在Managed
Time of Update: 2018-12-05
用到的類主要有HttpListener、StreamWriter. HttpListener:使用HttpListener可建立響應 HTTP 要求的簡單 HTTP
Time of Update: 2018-12-05
一、抽象類別: 抽象類別是特殊的類,只是不能被執行個體化;除此以外,具有類的其他特性;重要的是抽象類別可以包括抽象方法,這是普通類所不能的。抽象方法只能聲明於抽象類別中,且不包含任何實現,衍生類別必須覆蓋它們。另外,抽象類別可以派生自一個抽象類別,可以覆蓋基類的抽象方法也可以不覆蓋,如果不覆蓋,則其衍生類別必須覆蓋它們。 二、介面: 介面是參考型別的,類似於類,和抽象類別的相似之處有三點: 1、不能執行個體化;
Time of Update: 2018-12-05
在C#程式中使用系統熱鍵 1.首先引入System.Runtime.InteropServicesusing System.Runtime.InteropServices;2.在類內部聲明兩個API函數,它們的位置和類的成員變數等同.[System.Runtime.InteropServices.DllImport("user32.dll")] //申明API函數public static extern bool RegisterHotKey(IntPtr hWnd, // handle to
Time of Update: 2018-12-05
using Microsoft.Win32; Creating SubKeys in the registryWe create a subkey by using the CreateSubKey method. We usually want to create a subkey in HKEY_CURRENT_USER/SOFTWARE that is why we use the following
Time of Update: 2018-12-05
首先從原理上解釋一下採用Socket介面的網路通訊,這裡以最常用的C/S模式作為範例,首先,服務端有一個進程(或多個進程)在指定的連接埠等待客戶來串連,服務程式等待客戶的串連資訊,一旦串連上之後,就可以按設計的資料交換方法和格式進行資料轉送。用戶端在需要的時刻發出向服務端的串連請求。這裡為了便於理解,提到了一些調用及其大致的功能。使用socket調用後,僅產生了一個可以使用的socket描述符,這時還不能進行通訊,還要使用其他的調用,以使得socket所指的結構中使用的資訊被填寫完。 在使用T
Time of Update: 2018-12-05
//這是一個webserviceprivate AppUpdate.UpdateServ UpdateSvr; private void button1_Click(object sender, System.EventArgs e) { if(LinkWebServices()==true) { this.label1.Text="串連伺服器....... PASS"; if(CheckVer()==true) { this.label2
Time of Update: 2018-12-05
SFINEA in C++作者:唐風出處:http://www.cnblogs.com/liyiwen本文著作權歸作者和部落格園共有,歡迎轉載,但請保留此段聲明,且在文章頁面明顯位置給出原文串連,否則保留追究法律責任的權利。SFINAE(substitution failure is not a error)
Time of Update: 2018-12-05
C#中indexof和substring函數用法2008-04-01 16:39indexof() :在字串中從前向後定位字元和字串;所有的傳回值都是指在字串的絕對位置,如為空白則為- 1string test="asdfjsdfjgkfasdsfsgfhgjgfjgdddd";test.indexof('d') =2 //從前向後 定位 d 第一次出現的位置 test.indexof('d',1) =2 //從前向後
Time of Update: 2018-12-05
Animal.h#ifndef ANIMAL_H_H#define ANIMAL_H_Hclass Animal{public: Animal(int height,int weight); void eat(); void sleep(); virtual void breathe();//=0;};#endif Animal.cpp#include "Animal.h"#include <iostream.h>Animal::Animal(int height,int
Time of Update: 2018-12-05
好久沒有用到delegate,幾乎都忘記怎麼寫了。下面是我寫的一個小例子: 1class Program 2 { 3 public delegate void MyDelegate(String name); //聲明代理 4 5 public static void MyDelegateFunc(String name) 6 { 7 System.Console.WriteLine("hello:" + name); 8
Time of Update: 2018-12-05
轉載自: http://www.wangchao.net.cn/it/detail_52411.html代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->父視窗: using System; using System.Collections.Generic; using System.ComponentModel; using
Time of Update: 2018-12-05
原網址: http://q.cnblogs.com/q/9762/ C#寫的程式,在關機時不能退出,導致系統不能關機。0 懸賞園豆:10 [已關閉問題] 問題為何被關閉 瀏覽: 981次C#寫的程式,在關機時不能退出,導致系統不能關機。我的環境是 win Xp, .NET Framework 2.0。.NET技術藏積 | 初學一級 | 園豆:165提問於:2009-10-12 16:46 問題補充: 嘗試使用: [STAThread] static void Main() { ........
Time of Update: 2018-12-05
以前都是轉寄別人的貼子,今天發一個我的學習筆記.廢話不多說,見下:(1)比較字串CompareTo:str1.CompareTo(str2); 返回int 如果str1長於str2 返回1 如果str2長於str1則返回-1如果相等,則返回0Equals:str1.Equals(str2); 返回bool如果str1與str2相等 則返回True,否則返回False(2)定位字元Int i =