惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
The GitHub Blog
The GitHub Blog
C
Check Point Blog
博客园_首页
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
G
GRAHAM CLULEY
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
K
Kaspersky official blog
博客园 - 司徒正美
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
V
V2EX - 技术
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Spread Privacy
Spread Privacy
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
SecWiki News
SecWiki News
Schneier on Security
Schneier on Security
O
OpenAI News
Jina AI
Jina AI
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
Y
Y Combinator Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed
I
InfoQ
D
Docker
P
Palo Alto Networks Blog
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
博客园 - Franky
B
Blog
Scott Helme
Scott Helme
博客园 - 叶小钗
D
DataBreaches.Net

博客园 - 悟空空

Firefox IE兼容性js笔记 Firefox,Safari与IE兼容性问题整理 调用dll给winform程序创建所有用户均可使用的快捷方式 SQL Server获取TEXT字段的内容长度 正则表达式笔记 Silverlight 4简体中文正式版脱机帮助文档安装说明 [原创]利用CPAU静默调用其它程序 - 悟空空 - 博客园 CPAU参数说明 - 悟空空 - 博客园 apache_2.2.4和php-5.3.2安装过程问题整理 Rectangle 属性 SSL网站自动安装根目录证书(整理备用)javascript - 悟空空 NND年年回家这么难买火车票 - 悟空空 DoubleAnimation 类 - 悟空空 Storyboard 类 - 悟空空 CroppedBitmap 类 - 悟空空 Windows Presentation Foundation 中的 Pack URI WPF 性能分析工具 - 悟空空 CompositionTarget 类 SolidColorBrush 类 - 悟空空
在cs类中调用嵌入资源并输出流 - 悟空空 - 博客园
悟空空 · 2010-11-19 · via 博客园 - 悟空空

using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using System.Web.UI;

[assembly: WebResource("MenuPurview.Resource.style.css", "text/css", PerformSubstitution = true)]
namespace MenuPurview
{
    public class MenuCss

    {

    //调用嵌入资源并输出流

        public static string ReadRes(string ResName)
        {
            Assembly myAssembly = Assembly.GetAssembly(typeof(MenuPurview.MenuCss));
            Stream myStream = myAssembly.GetManifestResourceStream(ResName);
            StreamReader sr = new StreamReader(myStream);
            string s = sr.ReadToEnd();
            return s;
        }
    }

}

调用部分

string s=MenuCss.ReadRes("MenuPurview.Resource.style.css") ;