c# 使用WebClient DownloadData出错

抛出异常的语句

string RecvStr = Encoding.ASCII.GetString(client.DownloadData("http://***/latestversion.txt"));

异常信息

发生了 System.IO.IOException
  IsTransient=false
  Message=指定的注册表项不存在。
  Source=mscorlib
  StackTrace:
       在 Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
  InnerException: 

用webclient读数据和注册表有什么关系。。如何解决?

阅读 5.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进