switch (readtype) { case "float": string targettype = "System.Single"; convertvalue = AppDomain.CurrentDomain.GetAssemblies().First( ).GetType(targettype) .InvokeMember("Parse", BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public, null, null, new object[] { convertvalue.ToString() }); convertvalue = float.Parse(convertvalue.ToString()); break; }
标签:convertvalue,targettype,C#,float,字符串,BindingFlags,类型,null From: https://www.cnblogs.com/JohnnyLei/p/17166512.html