Time of Update: 2018-12-07
文章目錄 1.通過控制台調用C#編譯器2.通過控制台調用IL反組譯碼工具(Ildasm) 1.通過控制台調用C#編譯器 通過控制台直接調用C#編譯器方便我們編寫片段代碼時不使用Visual Studio也能夠對源碼進行編譯。在通過使用控台命令列調用C#編譯器時,我們需要預先設定好作業系統的環境變數, 在Path變數中添加:;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319。在這裡我選擇的是C# 4
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 <stdio.h>#define MAX 30#define S 3void main(){ int i,j,k,temp,Monkey[MAX]; for(i=0;i<MAX;i++) Monkey[i] = i+1; //為猴子賦值 使其成為一串 for(i=MAX-1;i>=0;i--){ //最後只剩下一隻猴子。所以要執行30次
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>#define MAXLENGTH 1000typedef struct{ int total; int date[MAXLENGTH];}lineList;void showList(lineList* list){ int i; if(list->total ==0){ printf("空的線性表\n"); return; }
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
文章目錄 關於...的使用錯誤的嵌套-Misnesting由操作符優先順序引起的問題-Operator Precedence Problem消除多餘的分號-Semicolon SwallowingDuplication of Side Effects
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
using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Security.Cryptography;namespace ConsoleApplication1{ class Program { public static string Encrypt3DES(string a_strString, string a_strKey)
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