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
轉載于:https://www.cnblogs.com/glacierh/archive/2008/08/06/1261708.html
總結
以上是生活随笔為你收集整理的C#编码规范(3):常用变量和控件在变量命名中缩写的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一个反编译工具Reflactor (.N
- 下一篇: Google昨天发布的新产品——Goog