Time of Update: 2018-12-06
今天在園子裡看到一個人問,如何讓兩個DataGridView保持同步滾動? 一個最簡單方法:) 不過大資料量時候閃啊閃。 private void dataGridView1_Scroll(object sender, ScrollEventArgs e) { dataGridView2.FirstDisplayedScrollingRowIndex = dataGridView1.FirstDisplayedScrollingRowIndex;
Time of Update: 2018-12-06
亂寫的,別笑話。 是為了自己回憶一下一個小技巧。同時也希望能給需要的人帶來一定點兒的協助:)電話是沒用到:)using System;using System.Collections.Generic;using System.Text;using System.Collections;using System.Collections.Specialized;namespace 嵌套類{ class Program { static void Main(string[]
Time of Update: 2018-12-06
呵呵,僅IE有效:)前台代碼:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><ht
Time of Update: 2018-12-06
今天利用一點休息時間,隨便翻了翻桌子上擺的一大摞書,看到了一小段代碼,你也試試。using System;using System.Collections.Generic;using System.Text;using System.IO;namespace DotNetFramework{ class Program { static void Main(string[] args) { Point point = new Poin
Time of Update: 2018-12-06
using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Data.OleDb;using System.Configuration;using System.Collections;namespace PatternsStudy1{ class Program { /// <summary> /// 程式進入點
Time of Update: 2018-12-06
哈哈哈~看代碼:)想必單件模式大家都非常熟悉:)namespace Singleton1{ class Program { static void Main(string[] args) { for (int i = 0; i < 10; i++) { Factory.RecordCount(); } Factory.Display(
Time of Update: 2018-12-06
昨天朋友去面試,遇到了一個很常見的C#筆試題。發現現在好多公司都是在網上隨便找點題來筆試。以前看到過的一種方法,沒有時間查了,憑印象寫的,誰寫的如果看到,確認一下。using System;using System.Collections.Generic;using System.Text;namespace CatAndMouse{ public delegate void CatEventHandle(int score); class Sleeping {
Time of Update: 2018-12-06
在.net2.0中提供了Stopwatch類,簡單例子using System.Diagnostics;private Stopwatch stw = new Stopwatch(); private void Form1_Load(object sender, EventArgs e) { stw.Start(); } private void Form1_FormClosing(object sender, For
Time of Update: 2018-12-06
嘻嘻,同樣,不是送給高手,是我自己回憶一下,給自己以及也忘記的人看的。using System;using System.Collections.Generic;using System.Text;namespace 狀態模式1{ class Program { static void Main(string[] args) { 狀態介面 狀態1 = new 生病(); 狀態介面 狀態2 = new 健康();
Time of Update: 2018-12-06
隨便寫了一下,肯定有好的方法,不知道為什麼出這個題?也是網上找的? ???
Time of Update: 2018-12-06
添加引用:System.configuration.dll,System.Windows.Forms.dllusing System;using System.Collections.Generic;using System.Text;using System.Configuration;using System.Data;using System.Data.OleDb;using System.Windows.Forms;namespace PatternsStudy3{ class P
Time of Update: 2018-12-06
有很多時候我們需要讓表單的關閉按鈕無效,所以。。。。首先引入命名空間。using System.Runtime.InteropServices;然後DllImport以及常量聲明。 [DllImport("user32", EntryPoint = "GetSystemMenu", SetLastError = true,CharSet = CharSet.Unicode, ExactSpelling = true,CallingConvention = CallingConventi
Time of Update: 2018-12-06
Time of Update: 2018-12-06
記錄下來,很多時候為了一點小問題浪費時間,就像昨天,給一個同事講下限非0多維陣列,居然用了將近半個小時,哈哈~using System;using System.Collections.Generic;using System.Text;namespace DotNetFramework{ class Program { static void Main(string[] args) { //---------------------
Time of Update: 2018-12-06
今天遇到的問題,記下來,主要是想回憶一下IEnumerable也可以做資料來源。using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.
Time of Update: 2018-12-06
憑印象,可能概念不對? 等我晚上回去看看書,也歡迎大家幫我:)using System;using System.Collections.Generic;using System.Text;namespace 產生器模式{ class Program { static void Main(string[] args) { try { //要想升學一定要學習
Time of Update: 2018-12-06
這樣做了感覺多此一舉,不過當初學習合成模式的時候,想到的。效率低,只有一個目的,協助理解合成模式,也不知道能不能起到這樣的作用。不要笑話我哦:)using System;using System.Collections.Generic;using System.Text;using System.IO;namespace PatternsStudy6_1{ class Program { private static int intCount = 0; /
Time of Update: 2018-12-06
朋友那天去面試,還有一題,寫出一個簡單的singleton。部落格園好多人都寫過了,自己寫一個留備份。關於私人建構函式,以前寫過。[再讀書]私人建構函式。代碼: class Program { static void Main(string[] args) { Factory ft1 = Factory.GetFactory(); ft1.RecordCount(); ft1.DisPlay
Time of Update: 2018-12-06
在.net1.1中這樣寫Hashtable htTemp = new Hashtable( new CaseInsensitiveHashCodeProvider(), new CaseInsensitiveComparer() );到了,.net2.0後提示到期所以可以像下面這樣寫。class myCultureComparer : IEqualityComparer { #region IEqualityComparer 成員 public CaseInse
Time of Update: 2018-12-06
class Person { private string strName = string.Empty; public Person(string strName) { this.strName = strName; } public string StrName { get { return strN