日期:2009-01-15 浏览次数:20438 次
ResourceWriter rw = new ResourceWriter ( "My.resources" ) ; rw.Generate ( ) ; |
public void AddResource ( string , byte [ ] ) ; |
public void AddResource ( string , object ); |
Icon ico = new Icon ( "Demo.ico" ) ; Image canceloff = Image.FromFile ("cancel-off.png") ; Image cancelon = Image.FromFile ( "cancel-on.png" ) ; Image cancelover = Image.FromFile ( "cancel-over.png" ) ; Image okdown = Image.FromFile ( "ok-down.png" ) ; Image okoff = Image.FromFile ( "ok-off.png" ) ; Image okon = Image.FromFile ( "ok-on.png" ) ; rw.AddResource ( "demo.ico" , ico ) ;//在资源文件中加入图标 //以下是在资源文件中加入图象 rw.AddResource ( "cancel-off.png" , canceloff ) ; rw.AddResource ( "cancel-on.png" , cancelon ) ; rw.AddResource ( "cancel-over.png" , cancelover ) ; rw.AddResource ( "ok-down.png" , okdown ) ; rw.AddResource ( "ok-off.png" , okoff ) ; rw.AddResource ( "ok-on.png" , okon ) ; |
rw.AddResource ( "MyStr" , "从资源文件中读取字符串!" ); |
rw.Close ( ) ; |
CreatResources.cs: using System ; using System.Drawing ; using System.Resources ; class CreatResource { public static void Main ( ) { ResourceWriter rw = new ResourceWriter ( "My.resources" ) ; Icon ico = new Icon ( "Demo.ico" ) ; Image canceloff = Image.FromFile ("cancel-off.png") ; Image cancelon = Image.FromFile ( "cancel-on.png" ) ; Image cancelover = Image.FromFile ( "cancel-over.png" ) ; Image okdown = Image.FromFile ( "ok-down.png" ) ; Image okoff = Image.FromFile ( "ok-off.png" ) ; Image okon = Image.FromFile ( "ok-on.png" ) ; rw.AddResource ( "demo.ico" , ico ) ; rw.AddResource ( "cancel-off.png&quo
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
|