类型转换的问题:
Dim appsetting as Hashtable=CType(System.Configuration.ConfigurationSettings.GetConfig("appSettings"),Hashtable)
如果写成c#改如何写???
1)
object ob=System.Configuration.ConfigurationSettings.GetConfig("appSettings");
Hashtable appsetting=ob;
2)
object ob=System.Configuration.ConfigurationSettings.GetConfig("appSettings");
Hashtable appsetting=(Hashtable )ob;
3)
Hashtable appsetting=(Hashtable )System.Configuration.ConfigurationSettings.GetConfig
以上几种都出现错误。转换的类型不对。。
为什么??正确的该如何写??