1、where T: new()
where后的称为泛型约束,这里约束泛型参数T必须具有无参的构造函数

2、判断路径是本地路径还是网址

 private static bool IsLocalPath(string p)
 {
       return new Uri(p).IsFile;
 }
View Code

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2022-01-06
  • 2022-01-23
  • 2021-12-31
猜你喜欢
  • 2022-01-07
  • 2022-02-15
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-08-04
相关资源
相似解决方案