Time of Update: 2015-01-08
標籤:Linux下openssl提供了一系列雜湊及加密的函數,如果調用openssl提供的MD5函數產生任一字元串的MD5呢?下面提供了一段代碼實現Linux下c字串產生md5的函數。具體代碼: 123456789101112131415161718192021222324252627282930#include "stdio.h"#include <string.h>#include <stdlib.h>#include
Time of Update: 2015-01-05
標籤:檔案操作(Linux系統編程)建立一個目錄時,系統會自動建立兩個目錄.和..C語言實現許可權控制函數 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<sys/types.h> 4 #include<sys/stat.h> 5 6 int main(int argc , char **argv){ 7 int mode; 8 int mode_u; 9
Time of Update: 2015-01-05
標籤:1、system(執行shell命令)相關函數 fork,execve,waitpid,popen表標頭檔 #include<stdlib.h>定義函數 int system(const char * string);函數說明 system()會調用fork()產生子進程,由子進程來調用/bin/sh-cstring來執行參數string字串所代表的命令,此命令執行完後隨即返回原調用的進程。在調用system()期間SIGCHLD
Time of Update: 2015-01-13
標籤:近來項目中有需要用到一個技術:使用C#操控捷徑,包含建立和讀取等。現整理一下實現方式,分享給大家。第一步 建立一個項目無需廢話,跳過。第二步 引用COM組件右鍵“引用”,“添加引用”,選擇“COM組件”,找到“Windows Script Host Object Model”,然後確定。第三步 編寫建立捷徑的代碼建立捷徑//
Time of Update: 2015-01-13
標籤:public class CDisposable : IDisposable { //解構函式,編譯後變成 protected void Finalize(),GC會在回收對象前會調用調用該方法 ~CDisposable() { Dispose(false); }
Time of Update: 2015-01-13
標籤:要檢測檔案被那個進程佔用,需要使用微軟提供的工具Handle.exe,這裡有微軟提供的下載我們可以在c#中調用Handle.exe 來檢測到底哪個進程佔用了檔案 string fileName = @"c:\aaa.doc";//要檢查被那個進程佔用的檔案Process tool = new Process();tool.StartInfo.FileName = "handle.exe";tool.StartInfo.Arguments = fileName+"
Time of Update: 2015-01-13
標籤:WebClient:1.post字串 public string SendField_wc(string URL,string CookieData, string postData) { WebClient myWebClient = new WebClient(); myWebClient.Headers.Add("Cookie", CookieData); //添加文章
Time of Update: 2015-01-10
標籤:c# 程式開發 .net 最近在入門學習.NET編程,慢慢的學習了一些門道,同時也需要將學習的點點滴滴記錄下來,今天我就自己想了想,把水仙花數的代碼寫出來,運行也通過了,就貼在這裡,分享給大家,也給自己做一個記錄。using System;using System.Collections.Generic;using System.Linq;using System.Text;using
Time of Update: 2015-01-09
標籤:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Drawing.Drawing2D;namespace ReNamefolder{ public
Time of Update: 2015-01-10
標籤:一、運算式樹狀架構入門Lambda運算式樹狀架構很複雜,從概念上很難理解清楚,一句話,運算式樹狀架構是一種資料結構!這裡我們通過下面的這個例子來理解一下運算式樹狀架構,你就能看個大概:lambda運算式樹狀架構動態建立方法 static void Main(string[] args) { //i*j+w*x ParameterExpression a = Expression.Parameter(typeof(int),
Time of Update: 2015-01-09
標籤: 第一種最簡單,但沒有考慮安全執行緒,在多線程時可能會出問題 public class Singleton{ private static Singleton _instance = null; private Singleton(){} public&n
Time of Update: 2015-01-03
標籤:c++的寫法是這樣的:LRESULT CPictureQueryDlg::OnQueryPicNty(WPARAM wp, LPARAM lp){EnableWindow(TRUE);BYTE *pbyMsg = (BYTE*)lp;// 得到當前頁數目m_dwCurCount = *reinterpret_cast<DWORD*>(pbyMsg);// 得到總數量m_
Time of Update: 2014-12-31
標籤:很明顯,可以看到透過進度條的框框可以看到下面的軟體介面,之前出現這種情況是因為pictureBox和panel層級之間的關係造成的,沒想到這次的原因居然不是這樣,而是因為少了backColor這個屬性 this.progressTotal.BackColor = System.Drawing.SystemColors.Control;出現上述問題就是因為在designer.CS中少寫了這一行,加上之後:OK,沒有穿透的問題了C#的進度條透明的情況(穿透問題)
Time of Update: 2015-01-05
標籤:http://www.mkyong.com/computer-tips/cant-create-file-in-the-c-drive-root-directory-windows-8/ Developing a simple Java program to write a file in the C drive root directory (where Windows is installed), but the program prompts an
Time of Update: 2014-12-31
標籤: 以前感覺移位元運算符自己挺明白的,也許是學的時間長了,後來一看,忘得差不多了。現在參考一些網上的學習資料,將位移運算子整理一下,作為知識點總結,也算個積累。在講移位元運算符之前,先簡單補充一下原碼與補碼的知識。一.原碼與補碼 在電腦系統中,數值一律用補碼來儲存(表示)。主要原因:使用補碼,可以將符號位和其他位統一處理;同時減法也可按加法來處理。另外,兩個補碼錶示的數相加時,如果最高位(符號位)有進位,則進位被捨棄。 1.原碼轉補碼分兩種情況 (1)正數的補碼:與原碼相同(已知
Time of Update: 2014-12-27
標籤: namespace dxhbskymDemo{ public partial class ExcelForm : DevExpress.XtraEditors.XtraForm { public ExcelForm() { InitializeComponent(); } #region 匯出Excel //匯出按鈕 private void
Time of Update: 2015-01-12
標籤:#運算子用於在先行編譯時,將宏參數轉換為字串eg.#include <stdio.h>#define CONVERT(f)(#f)void helloworld(){printf("hi,tom welcome to you!");}int main(){printf("%s\n",CONVERT(hello
Time of Update: 2015-01-09
標籤:C編輯器 ,C-Free 5使用教程C-Free 5基本使用教程,看到很多人不知道怎麼使用C-Free 5,我就來詳細的製作出教程供大家學習。工具/原料windows系統C-Free 5安裝包 方法/步驟①首先開啟C-Free 5會出現這個畫面,他是讓你建立C-Free
Time of Update: 2015-01-08
標籤:freebsd 網路編程 daytimetcpcli 最近開始學習unix網路編程,開篇第一個程式daytimetcpcli.c編譯運行成功,就花費了很多心思,把問題匯總出來,供各位參考。FreeBsd unix 系統構建的vmware虛擬機器,之前對FreeBsd也是小白,雖說也玩過linux,對網路通訊這些設定啊還是不熟。書中原始碼如下:
Time of Update: 2014-12-28
標籤:0. UNREFERENCED_PARAMETER(X)避免編譯器關於未引用參數的警告。#pragma warning( push )#pragma warning( disable : 4100 )void DoSomething(...){}#pragma warning( pop )1. AppDelegate app建立app代理。2. CCEGLView* eglView = CCEGLView::sharedOpenGLView(),擷取GLView的指標。