Time of Update: 2017-02-28
編程 第三步 增加響應使用者事件代碼還有最後一步就可以大功告成了,就是增加一個方法來捕捉按鈕點擊事件。這裡就是指從攝氏到華氏的按鈕點擊代碼:private void bnCtoF_Click(Object sender, EventArgs e) {double dTempCel = 0;double dTempFah = 0;try { dTempCel = tTempCel.Text.ToDouble(); }catch(Exception)
Time of Update: 2017-02-28
教程 第二節:讀取命令列輸入 許多程式可以接受命令列輸入,下面的程式就是接受命令列的輸入後,再把它列印到控制台螢幕上。 程式1-2:NamedWelcome.cs // Namespace Declaration using System; // Program start class class NamedWelcome { // Main begins program execution. public static void
Time of Update: 2017-02-28
訪問|資料|資料庫 新近寫了個通用的資料庫訪問類(c#);支援oledb\sql\oracle\odbc資料連線,提供sysbase,db2
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
最近對C#產生了興趣,加上為回國做準備,需要拓寬一下視野,所以列了一個C#和.NET因為架構的書單,都是英文的,因為英文書原汁原味,內容也比較新。這個單子是根據google group和amazon的討論評價選出來的,著重點在於C#語言的基本概念和特點,.NET架構的深度詳細分析。.NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics
Time of Update: 2017-02-28
using System; using System.IO;//用於檔案存取 using System.Data;//用於資料訪問 using System.Drawing;//提供畫GDI+圖形的準系統 using System.Drawing.Text;//提供畫GDI+圖形的進階功能 using System.Drawing.Drawing2D;//提供畫進階二維,向量圖形功能 using System.Drawing.Imaging;//提供畫GDI+圖形的進階功能
Time of Update: 2017-02-28
用C#開發.NET CF 藍芽通訊模組在Windows Mobile軟體開發中.Net正扮演著日益重要的角色,我們已經可以看到很多用.Net CF開發的軟體,這些軟體涉及到了日常應用的方方面面。在智慧型裝置的軟體開發中,無線互聯是一個相當重要的一塊,我們可以看到,紅外幾乎是所有智慧型裝置的標配,而藍芽也日益在越來越多的智慧型裝置上出現,有了硬體,顯然要有相應的軟體相關的應用。我們也知道,用.NET CF開發紅外通訊應用時相當輕鬆的,因為.NET
Time of Update: 2017-02-28
xml C#操作XML初步(1)第一章:建立XML檔案下面也是用文本建立XML的方式 <% @ Import Namespace="System.IO" %><% @ Import Namespace="System.Xml" %><% @ Import Namespace="System.Data" %><Script
Time of Update: 2017-02-28
區別|數組 C#中數組是參考型別,C#定義整型數組方式是:int [] intArray = {1,2,3};或int [] intArray = new int[10];而C++中定義整型數組的方式是:int intArray[] = {1,2,3};或int * intArray = new
Time of Update: 2017-02-28
sina|天氣預報|頁面 頁面代碼:<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %><%@ Page language="c#" Codebehind="weather.aspx.cs" Inherits="goodwap.life.weather"
Time of Update: 2017-02-28
sina|天氣預報|頁面 public class weather : System.Web.UI.MobileControls.MobilePage { protected System.Web.UI.MobileControls.Label Label1; protected System.Web.UI.MobileControls.Label
Time of Update: 2017-02-28
演算法|條件 using System;namespace kmp{ /// <summary> /// Summary description for Class1. /// </summary> class Class1 { /// <summary> /// The main entry point
Time of Update: 2017-02-28
參考|函數 c#.net常用的小函數和方法集 1、DateTime 數字型 System.DateTime currentTime=new System.DateTime(); 1.1 取當前年月日時分秒 currentTime=System.DateTime.Now; 1.2 取當前年 int 年=currentTime.Year; 1.3 取當前月 int
Time of Update: 2017-02-28
visual|window|函數 Api函數是構築Windws應用程式的基石,每一種Windows應用程式開發工具,它提供的底層函數都間接或直接地調用了Windows API函數,同時為了實現功能擴充,一般也都提供了調用WindowsAPI函數的介面, 也就是說具備調用動態串連庫的能力。Visual
Time of Update: 2017-02-28
xml C#操作XML初步(1)第一章:建立XML檔案建立XML檔案有不同的方法,我這裡給出三種方式 <% @ Import Namespace="System.IO" %><Script Language="C#" Runat="Server">public void Page_Load(Object src,EventArgs e){ /** 版 權 :
Time of Update: 2017-02-28
上傳|上傳圖片
Time of Update: 2017-02-28
INI檔案就是副檔名為“ini”的檔案。在Windows系統中,INI檔案是很多,最重要的就是“System.ini”、“System32.ini”和“Win.ini”。該檔案主要存放使用者所做的選擇以及系統的各種參數。使用者可以通過修改INI檔案,來改變應用程式和系統的很多配置。但自從Windows
Time of Update: 2017-02-28
編程 C#是微軟.NET架構的主力開發語言,它功能廣泛而強大,Web開發人員應該毫不猶豫地擁抱它。本文就通過一個攝氏溫度與華氏溫度間相互轉換的例子對C# 的GUI編程進行介紹,旨在帶領你快速步入C#之強大與神奇的編程世界。準備條件要理解本文所舉常式,首先要對C#和物件導向的編程有一個基本的了解。關於 C#的基本知識,請參閱 C#入門 這篇文章。要編譯並運行舉例的應用程式,就需 下載 .NET Framework SDK,它當前的一個版本是Beta
Time of Update: 2017-02-28
你平時是怎麼讀取檔案的?使用流讀取。是的沒錯,C#給我們提供了非常強大的類庫(又一次吹捧了.NET一番),裡面封裝了幾乎所有我們可以想到的和我們沒有想到的類,流是讀取檔案的一般手段,那麼你真的會用它讀取檔案中的資料了嗎?真的能讀完全嗎?通常我們讀取一個檔案使用如下的步驟:1、聲明並使用File的OpenRead執行個體化一個檔案流對象,就像下面這樣 FileStream fs = File.OpenRead(filename);或者 FileStream fs =