開發命名規範

來源:互聯網
上載者:User


來自:http://blog.sina.com.cn/s/blog_005547d70100xcuf.html

ADO.NET命名規範

資料類型

資料類型簡寫

標準命名舉例

Connection

con

conNorthwind

Command

cmd

cmdReturnProducts

Parameter

parm

parmProductID

DataAdapter

dad

dadProducts

DataReader

dtr

dtrProducts

DataSet

dst

dstNorthWind

DataTable

dtbl

dtblProduct

DataRow

drow

drowRow98

DataColumn

dcol

dcolProductID

DataRelation

drel

drelMasterDetail

DataView

dvw

dvwFilteredProducts

WinForm Control 命名規範

資料類型

資料類型簡寫

標準命名舉例

Label

lbl

lblMessage

LinkLabel

llbl

llblToday

Button

btn

btnSave

TextBox

txt

txtName

MainMenu

mmnu

mmnuFile

CheckBox

chk

chkStock

RadioButton

rbtn

rbtnSelected

GroupBox

gbx

gbxMain

PictureBox

pic

picImage

Panel

pnl

pnlBody

DataGrid

dgrd

dgrdView

ListBox

lst

lstProducts

CheckedListBox

clst

clstChecked

ComboBox

cbo

cboMenu

ListView

lvw

lvwBrowser

TreeView

tvw

tvwType

TabControl

tctl

tctlSelected

DateTimePicker

dtp

dtpStartDate

HscrollBar

hsb

hsbImage

VscrollBar

vsb

vsbImage

Timer

tmr

tmrCount

ImageList

ilst

ilstImage

ToolBar

tlb

tlbManage

StatusBar

stb

stbFootPrint

OpenFileDialog

odlg

odlgFile

SaveFileDialog

sdlg

sdlgSave

FoldBrowserDialog

fbdlg

fgdlgBrowser

FontDialog

fdlg

fdlgFoot

ColorDialog

cdlg

cdlgColor

PrintDialog

pdlg

pdlgPrint

WebControl 命名規範

資料類型

資料類型簡寫

標準命名舉例

AdRotator

adrt

Example

Button

btn

btnSubmit

Calendar

cal

calMettingDates

CheckBox

chk

chkBlue

CheckBoxList

chkl

chklFavColors

CompareValidator

valc

valcValidAge

CustomValidator

valx

valxDBCheck

DataGrid

dgrd

dgrdTitles

DataList

dlst

dlstTitles

DropDownList

drop

dropCountries

HyperLink

lnk

lnkDetails

Image   

img

imgAuntBetty

ImageButton

ibtn

ibtnSubmit

Label

lbl

lblResults

LinkButton

lbtn

lbtnSubmit

ListBox

lst

lstCountries

Panel

pnl

pnlForm2

PlaceHolder

plh

plhFormContents

RadioButton

rad

radFemale

RadioButtonList

radl

radlGender

RangeValidator

valg

valgAge

RegularExpression

vale

valeEmail_Validator

Repeater

rpt

rptQueryResults

RequiredFieldValidator

valr          

valrFirstName

Table   

tbl        

tblCountryCodes

TableCell    

tblc    

tblcGermany

TableRow   

tblr    

tblrCountry

TextBox   

txt    

txtFirstName

ValidationSummary

vals   

valsFormErrors

XML   

xmlc     

xmlcTransformResults

變數
變數的範圍及首碼

首碼

說明

舉例

P

全域變數

pstrName

St

靜態變數

ststrName

M

模組或者表單的局部變數

MstrName

A

數組

AintCount[]

VARIANT 資料型別的首碼

C#資料類型

類庫資料類型

標準命名舉例

Sbyte

System.sbyte

sbte

Short

System.Int16

sht

Int

System.Int32

int

Long

System.Int64

lng

Byte

System.Byte

bte

Ushot

System.Uint16

usht

Uint

System.Uint32

uint

Ulong

System.Uint64

ulng

Float

System.Single

flt

Double

System.Double

dbl

Decimal

System.Decimal

dcl

Bool

System.Boolean

bol

Char

System.Char

chr

Object

System.Object

obj

String

System.String

str

 

System.DateTime

dte

IntPtr

System.Intpre

intptr

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.