Time of Update: 2018-12-07
C# 擷取MAC地址 方法一: 使用 ManagementClass string strMAC = ""; ManagementClass MC = new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection MOC = MC.GetInstances(); foreach (ManagementObject moc in MOC) { if
Time of Update: 2018-12-07
原文:http://www.cppblog.com/xiaozhuozhuo/archive/2007/07/23/28663.html▲1、C語言標準庫函數atoi()等。函數名: atoi 功 能: 把字串轉換成整型數 用 法: int atoi(const char *nptr); 程式例: #include <stdlib.h> int main(void) { int n; char *str = "435"; n = atoi(str); printf("string =
Time of Update: 2018-12-07
比較: public static extern int comp2(byte[] a, byte[] b, int count); [DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl, SetLastError = false)] static extern int memcmp(byte[] b1, byte[] b2, UIntPtr count);
Time of Update: 2018-12-07
CodeCode highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
一種簡單的加密CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;namespace md{class MainClass{ public interface IBindesh { string encode(string str)
Time of Update: 2018-12-07
C#委託Firstly,let us look back on function pointer in c, the following is an example.Function Pointer#include "stdafx.h"#include "stdio.h"#include "stdlib.h"int (*Test)(int l); //定義函數指標int Add(int t){return t+t;}int Mut(int t){return t*t;}//把函數做參數int
Time of Update: 2018-12-07
1、首先資料庫: f_id 項目ID號 ,f_front 父ID號 ,f_name名稱,f_type類型,f_layer所處層,f_order 同層的順序號;(f_layer,f_order不要也可,這裡我主要是需要同層排序才用到)2、然後“select f_id,f_front,f_name,f_type from data”取得DataSet資料集dsFrame;treeview 名稱設為tvDept3、寫函數 構建treeveiw樹形:public void AddTree(int
Time of Update: 2018-12-07
/**//**//**//// <summary> /// 繫結檔案分類 /// </summary> public void bind() { //擷取資料集 DataSet ds = new DataSet(); ds = ec.ExecuteSelectCmmond("select * from t_Column where U_UserID='" + HttpContext.Current.Re
Time of Update: 2018-12-07
現在發現VB真的很方便,C#雖然也不錯,但是對flash的處理,和一些控制項的使用還是不如VB方便!在VB上,flash的透明處理方便,只需修改flash控制項shockwaveFlash的WMode屬性:wmode = Transparent,但是在C#中,這樣設定,flash控制項根本沒反應!上網,百度、Google,搜搜搜!沒有得到解決方案,但是搜到了一個控制項
Time of Update: 2018-12-07
最近在公司實習,每次上班都要打卡,初來乍到,老是忘了!無奈寫了一個定時上公司OA打卡的程式!寫的過程中發現公司OA系統(網站)上的按鈕(圖片、超連結)很難Find,分析了一下網頁源碼,發現公司OA系統全是用Frame布局的,為了能精準定位,我用遞迴遍曆了一下OA系統的所有框,把每個架構裡的Html代碼都挖掘出來!以便定位自己要擷取的元素! // webBrowser先設定Url,然後填充資料(賬戶和密碼)實現自動登入OA,等網站載入完畢之後開始分析架構 //
Time of Update: 2018-12-07
1.調用COM組件:Type type = Type.GetTypeFromProgID("VisualPHD.Data"); dynamic phd = Activator.CreateInstance(type);phd.HostName = "192.168.53.186";2. 反射調用dotNet類Type type = Type.GetType("ConsoleApplication1.Test"); dynamic t =
Time of Update: 2018-12-07
Anders Hejlsberg談C#、Java和C++中的泛型原著:Bill Venners、Bruce Eckel 2004.2.26原文:http://www.artima.com/intv/generics.html翻譯:lover_P出處:http://www.cstc.net.cn/docs/docs.php?id=258[人物介紹] Anders
Time of Update: 2018-12-07
有一個員工管理,需要在資料庫欄位中儲存員工的照片,但已有的照片非常巨大,1024*768, 2M左右,這麼大的資料存入資料庫,不管是對管理或是傳輸都是問題,而實際上登記照只要很小就行了,下面進行減肥(C#)://可以讀取一些常用的格式,如jpg,bmp等Bitmap myBitmap = new Bitmap("c:\\t.bmp"); //產生80*100的縮圖Image myThumbnail = myBitmap.GetThumbnailImage(80, 100, null,
Time of Update: 2018-12-07
1. Vector類型是快速增加的,定義一個空的再新增成員,比定義指定長度的集合操作更快。因此即此能預判成員數量也沒必要定義長度。2. 在for迴圈時直接判斷Vector的size,因為size是內嵌函式,效率很高,沒必要增加一個變數儲存size再判斷。3. 在C++中迴圈Vector成員時使用!=size,而不推薦<size4. 標準庫中的string和直接字串(如:"123")是兩個不同的資料類型。5.
Time of Update: 2018-12-07
引言前段時間為客戶開發一套印表機配套的軟體,對C#中調用印表機做了些研究。問題.Net Framework
Time of Update: 2018-12-07
今天整理演算法的時候發現在過去在c++中用UINT指標訪問32位ARGB位元影像時,每次位移量正好一個象素,所以直接使用“++”而不是“+= 4”。同理,當直接用座標訪問時,應使用“i * stride / 4 + j” 而不是“i * stride +
Time of Update: 2018-12-07
建構函式 如果一個類不包含建構函式,那麼編譯器將建立一個名為“預設建構函式”的隱含方法,預設建構函式包含一個空白的參數列表。使用建構函式的注意事項 類的建構函式名要與類名相同 建構函式沒有傳回型別 一般情況下,建構函式是public類型的 不能顯式調用建構函式解構函式~類名(){statement}解構函式的注意事項 解構函式沒有參數 解構函式沒有傳回值 解構函式沒有修飾符 解構函式不能被重載 解構函式不能被顯式調用
Time of Update: 2018-12-07
一、關於數組對象和vector對象Account *pact = new Account[10]1.在堆中分配包含10個Account類對象的數組;2.用Account類預設建構函式初始化釋放*pact不要用delete pact只是第一個類對象上調用了解構函式;應該使用delete [] pact;vector<Point> vec(5);//I初始化過程
Time of Update: 2018-12-07
Exception 類 描述
Time of Update: 2018-12-07
用 C 語言編寫 Windows 服務程式的五個步驟(http://www.cnblogs.com/enterBeijingThreetimes/admin/EditPosts.aspx?opt=1) 原文:Yevgeny Menaker 翻譯:Northtibet下載原始碼 原文出處:Five Steps to Writing Windows Services in C摘要 Windows