C# GetManifestResourceStream 获取项目资源为null解决方案(亲测)

GetManifestResourceStream 获取项目资源为null

使用Stream s = assembly.GetManifestResourceStream(Assembly.GetExecutingAssembly().GetName().Name + resourceName) 获取资源文件,返回流为null,如图所示:

在这里插入图片描述

解决方案

设置资源文件的 属性,将生成操作属性值设置为嵌入的资源,如图所示:

在这里插入图片描述
再次运行程序,发现返回流不再是null,如图所示:

在这里插入图片描述

Python.xshd文件

本项目是准备写个简单的python编辑器,刚开始动手,有些丑:

在这里插入图片描述
分享写的初版样式文件Python.xshd,后续还会继续更新,大家可以据此按需修改:

<?xml version="1.0"?>
<SyntaxDefinition name="Python" extensions=".py" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
	<Color name="Comment" foreground="#008000" /> <!-- Green -->
	<Color name="String" foreground="#F2981D" /> <!-- Orange -->
	<Color name="Label" foreground="#000DBA" /> <!-- Blue -->
	<Color name="Note" foreground="#F2981D" /> <!-- Orange -->
	<Color name="Keywords_true" foreground="#2E9AFE" /> <!-- Blue -->
	<Color name="Keywords_print" foreground="#D7DF01" /> <!-- Yellow -->
	<Color name="Keywords_def" foreground="#045FB4" /> <!-- Blue -->
	<Color name="Keywords_int" foreground="#04B486" /> <!-- Green -->
	<Color name="Keywords_file" foreground="#00BFFF" /> <!-- Cyan -->
	<Color name="KeywordsStructure" foreground="#B404AE" /> <!-- Purple -->
	<Color name="KeywordsApi" foreground="#D7DF01" /> <!-- Yellow -->
	<Color name="KeywordsDigit" foreground="#99CC99" /> 

	<!-- This is the main ruleset. -->
	<RuleSet>
		<Span color="Comment" begin="#" />
		<Span color="Note" multiline="true" begin
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

鲁棒最小二乘支持向量机

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值