上午給公司的幾個新同事簡單講了講C#語言的基礎,經理讓出些題目給大家練練手。從網上找了找,也沒太合適的,就自己現編了一個,覺得難度還挺適中,也許以後出練習題、筆試題什麼都用得著,遂記錄如下:寫一個簡單的圖形列印程式,要求可以在dos視窗列印三角形,正方形和矩形。初級要求:支援的輸入參數:圖形類型,圖形大小,空心/實體,用來拼接線段的字元輸出:指定大小、指定類型、使用指定字元表現的空心或實體圖形比如,如果要用a實現一個大小為5的空心正方形,則顯示效果如下aaaaaa aa aa
代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> public class HotKey {//如果函數執行成功,傳回值不為0。 //如果函數執行失敗,傳回值為0。要得到擴充錯誤資訊,調用GetLastError。 [DllImport("user32.dll", SetLastError =
using System;using System.Runtime.InteropServices; class shoutdown{ [StructLayout(LayoutKind.Sequential, Pack=1)] internal struct TokPriv1Luid { public int Count; public long Luid; public int Attr; }
1. Windows Forms中禁用表單的關閉按鈕添加必要的命名空間:using System.Runtime.InteropServices; 添加必要的常數和API函數的引用private const int SC_CLOSE = 0xF060;private const int MF_ENABLED = 0x00000000;private const int MF_GRAYED = 0x00000001;private const int MF_DISABLED = 0x0000000
Technorati 標籤: 安裝,Visual C++ 6,VC6,VC,企業版,英文版,圖示,圖解本樣本安裝VC6用於編寫,編譯和調試C語言。下載:首先從網上下載英文企業版Visual Studio 6, 約250-650M。迅雷下載: http://www.gougou.com/search?search=vc%2B%2B%206&id=0 英文企業版Visual Studio 6安裝圖示: