1.int str_a=”33”
int i_a=Convert.ToInt16(str_a);轉換爲短整型(16)
2.charchar_a;
char_a=Convert.ToChar(65);
Response.Write(char_a); 將SCII碼錶的65轉成字符;
結果爲A
1. char_a; char_a=”hello world”.ToCharArray();將字符串轉爲字符型數組
2. 自動轉換類型;int age=10; Response.Write(“今年我”+age+”歲”);整型或其他類型,與字符串型加在一起,自動轉爲字符串型;或者另一種寫法:Response.Write(“今年我”+age.ToString()+”歲”);
3. Numb_fen=double.Parse(textbox_1.Text);
Lable_1.Text=Numb_fen;
Lable.ForceColor=System.Drawing.Color.Green;標籤前景色爲綠色;
將文本框的文字轉化爲double型;