Time of Update: 2017-02-28
web C#下的webservcie 實現代碼,很簡單一看就清楚了是完成什麼樣的功能了using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.Web;using System.Web.Services;namespace WebHelloZ5{ ///
Time of Update: 2017-02-28
繼承|區別 using System;using System.Collections;public class Nevermore60Customer:Customer{ public override string GetFunnyString() { return "Nevermore60.Nevenmore!"; }----------------------------------------------------
Time of Update: 2017-02-28
虛函數:由virtual聲明,它允許在派生類中被重寫,要重寫方法,必須先聲名為virtualpublic class myclass{ public virtual int myint() { 函數體; }}class myclass1:myclass{ public override int myint() { 函數體1; }}抽象類、抽象函數:由abstract聲明,在抽象類中可以定義抽象方法,抽象方法基本沒有執行代碼,派生類必須重寫它,提供其執行代碼public
Time of Update: 2017-02-28
string str="wecncnc<a href=\"list.asp?Page=1&boardid=33&t=656727&p=11&tp=%B9%AB%BF%AAICSI%B5%C4MP3%B7%BD%B0%B8%C9%E8%BC%C6\">下一頁</a>"; str+="wecncnc<a href=\"listww.asp?Page=1&boardid=33&t=656
Time of Update: 2017-02-28
對於像ComboBox等控制項,我們可以通過設定它們的DrawMode特性(Attribute)來對其進行繪製. 為了方便起見,我們先定義一個類StringColorObject(這與OwnerDraw本身沒有關係,只是針對這裡要使用到的ComboBox而特意書寫的一個類.類的命名得益於QuickStart).這個類本身很簡單: using System.Drawing; namespace OwnerDrawSample{ public class
Time of Update: 2017-02-28
可以通過調用kernel32.dll中的兩個api:WritePrivateProfileString,GetPrivateProfileString來實現對ini 檔案的讀些。具體實現的代碼如下:using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using
Time of Update: 2017-02-28
函數 //本周是本年第幾周private int DatePart(System.DateTime dt) { int weeknow = Convert.ToInt32(dt.DayOfWeek);//今天星期幾 int daydiff = (-1) * (weeknow+1);//今日與上周末的天數差 int days =
Time of Update: 2017-02-28
用戶端 建立介面 類型 對象名 Text屬性 Label Label1 Label Label2 使用者名稱: Label Label3 密碼 TextBox TextBox1 TextBox TextBox2 Button Button1 接收 Button Button2 退出 當發送的驗證通過Label1的text屬性就會顯示成功的訊息當發送的驗證沒有通過Label1的text屬性就會顯示失敗的訊息 顯示代碼
Time of Update: 2017-02-28
本人在寫這些類方法或函數的時候,難免有些錯誤或bug存在,請各位網友多多指教!shixiang9076@sina.com。using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;namespace WinMarket{ /// <summary> /// Classfun
Time of Update: 2017-02-28
轉換 在寫C#程式時,string和byte[]之間的轉換比較煩,在移植一些老程式時感覺很不好。我在C#中使用DES和TripleDES時移植一塊老代碼時也遇到了同樣的情況。為了下次不為同樣的事情煩惱,就寫了下面的協助類。 主要實現了以下的函數代碼中出現的Sidle是我的網名。/** @Author WuErPing* @Version 1.0* @Date 2004/11/30* @Description: */using
Time of Update: 2017-02-28
編碼|規範 C#編碼規範--------------------------- 一、類型級單位的命名1、類。以Class聲明的類,都必須以名詞或名詞短語命名,體現類的作用。如:Class Indicator當類是一個特性(Attribute)時,以Attribute結尾,當類是一個異常(Exception)時,以Exception結尾:Class ColorSetExceptionClass
Time of Update: 2017-02-28
xml 在C#使用XML注釋 簡介大多數程式員可能都聽說過Java內建的一個工具JavaDoc;使用它可以自動地為你的代碼產生HTML文檔。C#和C#編譯器也有類似的功能,不過它產生的是XML,而不是直接產生HTML。不過使用XML會使得文檔更加靈活。注釋文法
Time of Update: 2017-02-28
筆記|編程|進階
Time of Update: 2017-02-28
編程|技巧 一、判斷檔案或檔案夾是否存在使用System.IO.File,要檢查一個檔案是否存在非常簡單: bool exist = System.IO.File.Exists(fileName);如果需要判斷目錄(檔案夾)是否存在,可以使用System.IO.Directory:bool exist =
Time of Update: 2017-02-28
//************************************************************////下面給出三個簡單的方法,後面兩個方法是擴充,估計有時用得著//************************************************************// /// <summary> /// 縮小圖片 /// </summary> /// <param
Time of Update: 2017-02-28
基本思路是利用SHBrowseForFolder 於是有如下代碼: private enum BrowseFlag{ BIF_RETURNONLYFSDIRS = 0x0001, // For finding a folder to start document searching BIF_DONTGOBELOWDOMAIN = 0x0002, // For starting the Find Computer BIF_STATUSTEXT = 0x0004,
Time of Update: 2017-02-28
本人剛開始學c#,剛才在網上找了幾個構件c#語言編譯器,也許對剛剛入門的各位有點協助,同時也希望同時學習c#的個人能把你們找到的一些資料公布出來。(1)Borland公司的C#Builder是第一個獨立的.NET
Time of Update: 2017-02-28
其實很簡單了,不過這裡還是說一下,希望能給和我一樣的C#新手帶來協助背景:本人很愛看動畫片和漫畫,近日下載了火影忍者的漫畫,結果目錄中的圖片檔案命名方式是1,2,.....,10,....99,100,這樣在acdsee中觀看的順序就是1,10,100....不是按照數位順序,看起來比較鬱悶。故此就動手寫一個批量檔案改名的小程式,把檔案名稱補齊為3位,按照001,002,...,009,010,...這樣的順序。涉及到的知識:string的函數;File和Directory函數;Environm
Time of Update: 2017-02-28
觸發器|建立 第一步:在Visual Studio 2005中編寫代碼using System;using System.Data;using System.Data.Sql;using System.Data.SqlServer;using System.Data.SqlTypes;public partial class Triggers{ // Enter existing table or view for the target
Time of Update: 2017-02-28
語句 OracleConnection oc=new OracleConnection("data source=osserver;User Id=****;password=**");OracleCommand cmd=new OracleCommand("insert into cym1.uploadfile (filename,filecontent) values