標籤: ASP.NET串連資料庫的技術叫ADO.NET,它是用來向資料庫提交sql語句的一堆類。這裡串連的是Sql Server 2008資料庫,其他資料庫用法差不多,就是調用的類名不一樣。 首先在Web.config(本地的添加應用程式設定檔App.config,本地還要添加System.Configuration.dll程式集)上設定資料庫連接字串,添加如下節點代碼:<connectionStrings>
標籤: //輸入整數a和b, //若a²+b²大於100,則輸出a²+b²百位以上數字, //否則輸出兩數之和 /*Console.Write("請輸入整數a:"); int a = int.Parse(Console.ReadLine()); Console.Write("請輸入整數b:"); int
標籤:今天做項目的時候有個在產生二維碼並且在中間加入Logo的需求,動手試了幾把,總感覺效果沒有之前寫的好,就翻出舊代碼,果然還是熟悉的味道,產生一張如下 左邊是裡面的,右邊是我自己產生的原理比較簡單,但細節還是有些複雜,廢話不多說直接上代碼 public class QRCodeHelper{public static Bitmap GetThumbnail(Bitmap b, int destHeight, int
標籤: 在代碼顯示的時候,有行號會非常的方便舒服(可能是個人習慣)。 這讓我想到部落格園的代碼顯示,添加行號居然是在每一行代碼前添加數字,只能說是下下策,身為處女座的我對此很是不滿,雖然曾經也這樣想過。。 測試: 1 using System; 2 using System.IO; 3 using System.Collections.Generic; 4 using System.ComponentModel; 5 using System.Data; 6 using
標籤: c#語言可以開發許多程式外掛程式,其中包括瀏覽器外掛程式等等。 by the way,說起外掛程式, 我們首先想到的是遨遊瀏覽器,firefox, 用過firefox的人都知道它是一個外掛程式式程式。當一個功能需要,完全可以從網上下載一個外掛程式後,重啟後,就能使用。這個功能給我們帶來許多的方便之處,這就是外掛程式式程式的好處。
標籤:C# 計時器C#中一共有4中常用的計時器:System.Timers.Timer 和 System.Windows.Forms.Timer ,它的最低識為 1/18s。timeGetTime ,它的最低識別能達到 5ms 。System.Environment.TickCount ,它的最低識別為毫米級。QueryPerformanceCounter,它的最低識別為 1ms。//以QueryPerformanceCounter為例: public class Program {
標籤:C. Table Decorations You have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons. Three balloons attached to some table shouldn‘t have the same color.
標籤:Alice got a hold of an old calculator that can display n digits. She was bored enough to come up with the following time waster.She enters a number k then repeatedly squares it until the result overflows. When the result overflows, only the n