1
私はC#で新たなんだ、このコードを書く:
URI形式が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
どうすれば問題を解決できますか?ありがとう。
この質問の回答を参照してください:http://stackoverflow.com/questions/3460503/how-to-read-a-file-from-a-uri-using-streamreader – Sparrow
あなたのソース文字列には何もありませんか? – pinkfloydx33