• Visual C#中的winform/webform/asp.net控件命名规范


                                                                            1、控件命名规范

    类型 前缀 示例
    AdRotator adrt adrtTopAd
    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 ddl ddlCountries
    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

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

                                                                         3、变量命名规范

    类型 前缀 示例
    Array arr arrShoppingList
    Boolean bln blnIsPostBack
    Byte byt bytPixelValue
    Char chr chrDelimiter
    DateTime dtm dtmStartDate
    Decimal dec decAverageHeight
    Double dbl dblSizeofUniverse
    Integer int intRowCounter
    Long lng lngBillGatesIncome
    Object obj objReturnValue
    Short shr shrAverage
    Single sng sngMaximum
    String str strFirstName

                                                                             -----------------------------

    控件名

    简写

    控件名

    简写

    Web 窗体
    Label

    lbl

    TextBox

    tb

    Button

    btn

    LinkButton

    lb

    HyperLink

    hl

    Repeator

    rpt

    ImageButton

    ib

    DropDownList

    ddl

    ListBox

    lb

    DataGrid

    dg

    DataList

    dl

    CheckBox

    cb

    CheckBoxList

    cbl

    RadioButton

    rb

    RadioButtonList

    rbl

    Image

    img

    Panel

    pnl

    Calender

    cld

    AdRotator

    ar

    Table

    tbl

    PlaceHolder

    ph

    Xml

    xml

    RequiredFieldValidator

    rfv

    CompareValidator

    cv

    RangeValidator

    rv

    RegularExpressionValidator

    rev

    ValidatorSummary

    vs

    CustomValidation

    cv

    Literal

    ltl

    TreeView

    tv

    数据
    DataSet

    ds

    DataTable

    dt

    DataView

    dv

    SqlConnection

    sc

    SqlDataAdapter

    sda

    SqlCommand

    sc

    HTML
    Label

    lbl

    Button

    btn

    Reset Button

    rb

    Submit Button

    sb

    Text Field

    tf

    Text Area

    tr

    File Field

    ff

    Password Field

    pf

    Checkbox

    cb

    Radio Button

    rb

    Hidden

    hdn

    Table

    tbl

    Flow Layout Panel

    flp

    Grid Layout Panel

    glp

    Image

    img

    Listbox

    lb

    常用词缩写
    Argument

    Arg

    Maximum

    Max

    Buffer

    Buf

    Message

    Msg

    Clear

    Clr

    Minimum

    Min

    Clock

    Clk

    Multiplex

    Mux

    Compare

    Cmp

    Operating System

    OS

    Configuration

    Cfg

    Overflow

    Ovf

    Context

    Ctx

    Parameter

    Param

    Delay

    Dly

    Pointer

    Ptr

    Device

    Dev

    Previous

    Prev

    Disable

    Dis

    Priority

    Prio

    Display

    Disp

    Read

    Rd

    Enable

    En

    Ready

    Rdy

    Error

    Err

    Register

    Reg

    Function

    Fnct

    Schedule

    Sched

    Hexadecimal

    Hex

    Semaphore

    Sem

    High Priority Task

    HPT

    Stack

    Stk

    I/O System

    IOS

    Synchronize

    Sync

    Initialize

    Init

    Timer

    Tmr

    Mailbox

    Mbox

    Trigger

    Trig

    Manager

    Mgr

    Write

    Wr

    一些在软件中常用的反义词组

    add/remove

    begin/end

    create/destroy

    insert/delete

    first/last

    get/release

    increment/decrement

    put/get

    add/delete

    lock/unlock

    open/close

    min/max

    old/new

    start/stop

    next/previous

    source/target

    show/hide

    send/receive

    source/destination

    cut/paste

    up/down

    如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮,您的推荐将是我最大的写作动力!欢迎各位转载,但是未经作者本人同意,转载文章之后必须在文章页面明显位置给出作者和原文连接,否则保留追究法律责任的权利。

    作者博客: http://www.cnblogs.com/yuwentao/
    联系QQ:511972961    点击这里给我发消息
    E-mail:511972961@qq.com
  • 相关阅读:
    1.3、python内置类型(0529)
    1.2、Python快速入门(0529)
    1.1、Python快速入门(0529)
    mini Linux制作过程(25/01)
    samba基本应用24-4及示例
    Apache+Php+Mariadb+NFS+discuz
    U盘中病毒了怎么办
    bind9安装配置
    负载均衡的实现(1)
    MySQL之优化
  • 原文地址:https://www.cnblogs.com/yuwentao/p/4692814.html
Copyright © 2020-2023  润新知