【发布时间】:2017-02-04 23:23:40
【问题描述】:
我是 C# 新手,编写以下代码:
const string file ="http://ipaddress/"+"1.jpg";
var fileName = file.Split('\\').Last();
using (var fileStream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
{
var fts = new FileToSend(fileName, fileStream);
await Bot.SendPhotoAsync(update.Message.Chat.Id, fts, "Nice Picture");
}
但在这一行:
using (var fileStream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
收到此错误:
URI formats are not supported
我该如何解决这个问题?谢谢。
【问题讨论】:
-
查看这个问题的答案:stackoverflow.com/questions/3460503/…
-
为什么在源字符串中没有“/”时拆分?
标签: c#