这是我的代码:
bool ch=Type.IsBuiltIn("System.Int32"); // not working-> syntax error
public static class MyExtentions
{
public static bool IsBuiltIn(this Type t, string _type)
{
return (Type.GetType(_type) == null) ? false : true;
}
}
Run Code Online (Sandbox Code Playgroud)
请通过IsBuiltIn新方法获得Extend Type Class
这是我的代码:
Register(Assembly.GetExecutingAssembly()).Location);
private void Register(String assemblyName)
{
System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo("D://gacutil.exe", string.Format("/i {0}", assemblyName));
processStartInfo.UseShellExecute = false;
System.Diagnostics.Process process= System.Diagnostics.Process.Start(processStartInfo);
process.WaitForExit();
}
Run Code Online (Sandbox Code Playgroud)
如何将DLL添加到程序集文件夹?
我可以在C#中这样做:
string str="string";
Type typ=typeof(str);
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我创建通用类型转换器而无需多个条件