Time of Update: 2018-12-07
思維導圖 點擊查看大圖 介紹 做為php開發工程師,要想在技術上有所提高,必須要對C有更深入的瞭解。PHP工程師接觸最多的就是apache伺服器,所以今天先拿它練練手。不當之處,大家多多指教。 Apache支援許多特性,大部分通過模組擴充實現。 準備條件 安裝apache.我安裝的版本是httpd-2.2.22,注意高版本在安裝過程中問題比較多,建議安裝比較低一些的版本。 安裝過成根據httpd裡面的INSTALL檔案進行安裝。 Apache的安裝目錄是/opt/modules/
Time of Update: 2018-12-07
public static class JsonHelper { /// <summary> /// JSON序列化 /// </summary> public static string JsonSerializer<T>(T t) { //so DataContractJsonSerializer ser = new
Time of Update: 2018-12-07
在winform裡拖入一個datagridview控制項,跟一個openfiledialog控制項,這個例子的功能只是讀取excel檔案,其他的功能本人還在研究當中獻上代碼using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using
Time of Update: 2018-12-07
近期在做DSOFramer這個控制項,打算自己弄一個自訂控制項來封裝這個COM組件,中間遇到很多曲折,研究了一個星期,終於完成了下面總結一下我做DSOFramer這個自訂控制項的注意地方:1、在建立一個Windows表單控制項陳列庫的時候,那個項目路徑裡不能有中文,比如:D:\C#練習\WindowsFormsDsoframer
Time of Update: 2018-12-07
#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAX 100void insertSort(char *arr, int total){ int i,j,pos; char temp; for(i=1;i<total;i++){ j = i-1; temp = arr[i]; while(j>=0 &
Time of Update: 2018-12-07
#include <stdio.h>void swap(int *p1,int *p2){ int p; p = *p1; *p1 = *p2; *p2 = p;}void main(){ int a,b; int *p1 = &a,*p2 = &b; printf("請輸入兩個數:"); scanf("%d%d",&a,&b); if(a<b){ swap(p1,p2); }
Time of Update: 2018-12-07
文章目錄 一、流式檔案操作二、直接I/O檔案操作 在ANSI C中,對檔案的操作分為兩種方式,即流式檔案操作和I/O檔案操作,下面就分別介紹之。一、流式檔案操作這種方式的檔案操作有一個重要的結構FILE,FILE在標頭檔stdio.h中定義如下: 1 typedef struct { 2 int level; /* fill/empty level of buffer */ 3 unsigned flags; /* File status
Time of Update: 2018-12-07
#include<math.h>int checkPrimer(double a){ //驗證是否為質數 unsigned long i, asqrt; asqrt = (unsigned long)sqrt(a); for(i =2;i<= asqrt;i++){ if((int)a % i == 0) return 0; } return 1;}int checkTruth(unsigned
Time of Update: 2018-12-07
#include "stdio.h"#define N 5void main(){ int a[5],num,i=0,j,temp; while( i< N ){ printf("請輸入1~9的數"); scanf("%d",&num); if(num>9 || num<0){ printf("輸入範圍不正確\n"); continue; } a[i++]
Time of Update: 2018-12-07
#include <stdio.h>#include <string.h>#include <stdlib.h>#define MAX 100void selectSort(char *arr, int total){ int i,j,pos; char temp; for(i=0;i<total-1;i++){ pos = i; //此處需注意每次排序是一定要給pos 賦值
Time of Update: 2018-12-07
#include "stdio.h"#include "stdlib.h"void main(){ FILE *fp1 ,*fp2; char c; if((fp1 = fopen("test.txt","w")) == NULL){ printf("can't create the file"); } while((c = getchar()) != '\n') fputc(c,fp1); fclose(fp1)
Time of Update: 2018-12-07
#include <stdio.h>int main(){ float sum = 0.0,avg = 0.0; int Good ,normal,fine,bad,num ,count; count = num = Good = normal = fine = bad = 0; scanf("%d",&num); while(num>0 && num<101){ sum += num;
Time of Update: 2018-12-07
#include <stdio.h>#include <stdlib.h>#define MAXLENGTH 1000struct linkNode{ int date; struct linkNode *link;};typedef struct linkNode linkNode;linkNode* createLinkNode(){ int i ; linkNode *node ,*p,*_temp; node =
Time of Update: 2018-12-07
字串串連 strcmp#include <stdio.h>void main(){ char c1[] = "Hello ", c2[]="WORLD", c3[13]; int i,j,k; i=j=k=0; while(c1[i] != '\0' || c1[j] != '\0'){ if(c1[i] != '\0'){ c3[k] = c1[i++]; }else{ c3[k] = c2[j++]; }
Time of Update: 2018-12-07
//產生 100~200的隨機數#include <stdio.h>#include <stdlib.h>int min;int find(){ int i, y, x,max; x = rand()%101 + 100; max = x; min = x; printf("產生的隨機數為:\n%d\n",x); for(i =0;i<9;i++){ y = rand()%101 + 100; printf("%d\t\n",
Time of Update: 2018-12-07
using System;using System.Text;using System.Text.RegularExpressions;using System.IO;using System.Web;/// <summary>/// CG2BFilter 的摘要說明/// </summary>public class CG2BFilter : Stream{ Stream responseStream; long position; StringBui
Time of Update: 2018-12-07
文章目錄 2.1. WebBrowser控制項2.2. TabControl控制項 1. 為什麼我們需要多選項卡的瀏覽器控制項項目中需要使用WinForm應用程式來封裝BS應用程式的瀏覽器外殼,在.NET的WebBrowser中沒有多索引標籤式瀏覽的內建配置屬性,我們需要實現多選項卡的瀏覽器控制項來實現封裝BS應用程式的目的,而不會彈出IE瀏覽器視窗。2. 我們需要瞭解哪些知識點2.1.
Time of Update: 2018-12-07
VC#編繹分為兩部分一個是從程式碼到IL(中繼語言) 二個是從中繼語言到機器語言(JIT編繹器)編繹參數 CSC.EXE把VC#程式碼騙譯成IL檔案 @ 指定回應檔 /debug 發送調試資訊 /debug+ 就會建立一個PDB檔案把調試資訊寫入檔案 /debug-不會建立PDB檔案,預設選項 /doc 把處理的文檔注釋為XML檔案 /out 批定輸出檔案 /reference 從包含集合的檔案中匯入中繼資料 /target 指定輸出檔案的格式 /target:exe 建立一個可執行(
Time of Update: 2018-12-07
-文法糖,意指那些沒有給電腦語言添加新功能,而只是對人類來說更“sweet”的文法,意在使得編程風格更易讀。C#2.0,3.0發布的新特性,除了泛型不是文法糖,其他所有的新特性幾乎都是文法糖。-但初學者往往因為不瞭解這些文法糖,從而在閱讀代碼的時候,難以理解其真正的運作方式。最著名的莫過於Lamda運算式,第一次看到它,很多人都會頂個大問號把。。。-文章前面會伴隨一些讓人看著想吐槽的代碼,請大家自行河蟹。然後我們會介紹一些文法糖來潤色一下,方便初學者們知道這些文法糖的原始意義。 我們來做一個L
Time of Update: 2018-12-07
2007-12-2619.5,這個例子。把CommProtocol及其子類都放在一個項目中,然後單獨產生幾個類的dll檔案,然後編譯項目,編譯成功。運行時卻總會報一個CommProtocol同時存在於{...}和{...}中,省略符號為GUID,看起來感覺這個類應該同時存在於兩個dll中,可是dll就這麼幾個,哪裡還有別的?!帶想不想的好幾天,沒搞明白怎麼回事,被嘯雨一句話點醒,可能是同時存在於所在項目所產生的這個exe和它所調用的dll中!!Bingo!!!果然是這個原因,產生dll以後,把這