0
當我讀到源代碼C#,我看到一行什麼是「。@ checked」的含義和調用?
return new Form(ElementType.Checkbox, ((IHTMLInputElement)htmlElement)[email protected]);
,但我不能用關鍵字[email protected]
找到它。
你能告訴我什麼叫[email protected]
及其含義?
更新答案
首先,感謝@Yeldar Kurmangaliyev,@Erik Funkenbusch和@TcKs。其次,我很抱歉做重複的帖子。因爲我用「。@檢查」進行搜索,什麼都沒看到。
最後,我明白了@
標誌幫助定義一個變量,其名稱是C# keyword
的一樣,這樣的:
string @string = "This is a string";
string str = @string; // str = "This is a string"
它只是一個名爲'checked'的屬性/成員。然而'checked'是C#關鍵字,所以你必須使用'@'來告訴編譯器它只是成員名稱。 –