設定或傳回表示電話號碼的字串。
public string PhoneNumber {
get,
set
}
備註
PhoneNumber 屬性是 PhoneCall 控制項的必要項。
PhoneCall 控制項的 PhoneNumber 屬性接受各種格式的字串。現在使用巴克斯格式 (又稱 BNF 語法,可描述檔案格式語法) 描述下列號碼類型:
phone_number ::= international_number | national_number |
short_number
international_number ::= "+" country_code national_number
short_number ::= "#" national_number
country_code ::= (decoration_character | digit)* digit
(decoration_character | digit)*
national_number ::= (decoration_character | digit)+
digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
decoration_character ::= "(" | ")" | "." | "-" | {space}
電話號碼是由任何順序的號碼組成,前面可以放選擇性國碼/區碼 (以加號開頭)。標示為 decoration_character 的字元可以出現在電話號碼中的任意處,但是會被忽略。
指定 i-Mode 的電話號碼時,目前有下列規則:
- 字串必須以「0」或「#」開頭。
- 以「0」開頭的字串,超過 9 個數字。
- 以「#」開頭的字串,超過 3 個數字。
- 字串中的數字可以包含「(」、「)」和「-」。
- 字串必須少於 24 個字元。
下列是有效的電話號碼範例:
800.522.2920
+1 (425) 885-8080
+91335303197
範例
下列範例示範如何使用 PhoneNumber 屬性設定電話號碼「555-0123」。
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PhoneCall1.Text="Humongous Insurance"
'Telephony-supported devices will call the following number.
PhoneCall1.PhoneNumber="555-0123"
'Browsers that do not have calling capability will navigate to
'the URL specified in as an alternate URL.
PhoneCall1.AlternateUrl="http://www.humongousinsurance.com"
End Sub
[C#]
public void Page_Load()
{
call1.Text="Humongous Insurance";
// Telephony-supported devices will call the following number.
call1.PhoneNumber="555-0123";
// Browsers that do not have calling capability will navigate to
// the URL specified in as an alternate URL.
call1.AlternateUrl="http://www.humongousinsurance.com" ;
}
<Mobile:Form runat=server id=frmChoice >
<mobile:PhoneCall runat="server" ID ="call1" />
</Mobile:Form>
請參閱
套用至:PhoneCall 類別