• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
只是向上走
采菊东篱下,悠然见南山。
博客园    首页    新随笔    联系   管理    订阅  订阅

C#编码规范(3):常用变量和控件在变量命名中缩写

 

 

基本类型:

数据类型             缩写

string                    str

int                         i

char                      chr

sbyte                     sb

byte                      bt

uint                       ui

long                      l

ulong                    ul

float                      f

double                   d

bool                      b

decimal                 dec

A、web控件 

控件名                                       缩写

AdRotator                                   art

Button                                         btn

Calendar                                      cd

CheckBox                                   chk

CheckBoxList                             chkl

CompareValidator                        cpv

CustomValidator                          ctv

DataGrid                                    dg

DataList                                     dl

DropDownList                            ddl

HyperLink                                  hl

Image                                        img

ImageButton                               Ibtn

Label                                          lbl

ListBox                                      lst

Panel                                          pl

PlaceHolder                                ph

RadioButton                                rb

RadioButtonList                           rbl

RangeValidator                            rv

RegularExpressionValidator           rev

Repeater                                     rp

RequiredFieldValidator                  rfv

Table                                          tb

TableCell                                    tc

TableRow                                   tr

TextBox                                     txt

ValidationSummary                      vs

XML                                          XML

 

B、html控件 

控件名                                      缩写

HtmlAnchor                                hah

HtmlButton                                 hbtn

HtmlForm                                   hform

HtmlGenericControl                     hgc

HtmlImage                                  himg

HtmlInputButton(按钮)            htxt

HtmlInputButton(重置)            hrbtn

HtmlInputButton(提交)            hcbtn

HtmlInputCheckBox                    hick

HtmlInputFile                              hifile

HtmlInputHidden                         hihidden

HtmlInputImage                          hiimg

HtmlInputRadioButton                  hirb

HtmlInputText(密码)               hpwd

HtmlInputText(文本)               hitxt

HtmlSelect                                  hslt

HtmlTable                                   htab

HtmlTableCell                              htc

HtmlTableRow                            htr

HtmlTextArea                              htxta

 

C、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

 

 

D、Win 控件命名规范 

类型                     前缀 

Button             btn       
Checkbox         chk

DropDownList   ddl

Combobox        cmb
Data grid           dgd
Data repeater    rpt
Form                frm
IFrame              ifr
Image               img

Label                lbl
List box            lst
Picture box        pic
ProgressBar       prg
RadioButton       rbt
Text box           txt
TreeView           trv

posted on 2009-05-05 11:15  jes.shaw  阅读(777)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3