mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-24 15:35:31 +00:00
@@ -4,14 +4,13 @@ using System.Resources;
|
||||
|
||||
namespace DiscordChatExporter.Core.Internal
|
||||
{
|
||||
internal static class AssemblyHelper
|
||||
internal static class Extensions
|
||||
{
|
||||
public static string GetResourceString(string resourcePath)
|
||||
public static string GetManifestResourceString(this Assembly assembly, string resourceName)
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var stream = assembly.GetManifestResourceStream(resourcePath);
|
||||
var stream = assembly.GetManifestResourceStream(resourceName);
|
||||
if (stream == null)
|
||||
throw new MissingManifestResourceException($"Could not find resource [{resourcePath}].");
|
||||
throw new MissingManifestResourceException($"Could not find resource [{resourceName}].");
|
||||
|
||||
using (stream)
|
||||
using (var reader = new StreamReader(stream))
|
||||
Reference in New Issue
Block a user