using System.IO; using System.Reflection; public static string GetEmbeddedResourceAsString(Assembly assembly, string resourceName) { using var stream = assembly.GetManifestResourceStream(resourceName); if (stream == null) return string.Empty; using var reader = new StreamReader(stream); return reader.ReadToEnd(); } // where resource name is in format: "NameSpace.ResourceFileNameWith.extension"
717300cookie-checkC# loading embedded resource as string