C#教程
C#控制语句
C#函数
C#数组
C#面向对象
C#命名空间和异常
C#文件IO
C#集合
C#多线程
C#其它

C# String GetType()

C# String GetType()

C# GetType() 方法用于获取当前对象的类型。它返回用于反射的 Type 类的实例。

Signature

public Type GetType()

参数

不带任何参数

返回

返回Type类的对象.

C# String GetType() 方法示例

    using System;  
    public class StringExample  
    {  
        public static void Main(string[] args)  
        {  
          string s1 = "Hello C#";
          Console.WriteLine(s1.GetType());
        }  
    }  
输出:
System.String
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4