我有一个嵌入式资源文件:
我需要将其作为流打开。
我尝试过的方法(没有成功,流为空):
![enter image description here](https://istack.dev59.com/sJiPA.webp)
我尝试过的方法(没有成功,流为空):
var assembly = Assembly.GetExecutingAssembly();
using (var stream = assembly.GetManifestResourceStream("client_secret.json"))
您有任何想法或建议吗?
编辑:我对它的处理方式:
using (var stream = assembly.GetManifestResourceStream("client_secret.json"))
{
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
// This OAuth 2.0 access scope allows an application to upload files to the
// authenticated user's YouTube channel, but doesn't allow other types of access.
new[] { YouTubeService.Scope.YoutubeUpload },
"user",
CancellationToken.None
);
}