楼上的同学,还是不行啊,这个你给我的连接里的代码。
Public Class WriteResources
Public Shared Sub Main(args() As String)
' Create a file stream to encapsulate items.resources.
Dim fs As New FileStream("items.resources", _
FileMode.OpenOrCreate, FileAccess.Write)
' Open a resource writer to write from the stream.
Dim writer = New ResourceWriter(fs)
' Add resources to the resource writer.
writer.AddResource("String 1", "First String")
writer.AddResource("String 2", "Second String")
writer.AddResource("String 3", "Third String")
' Write the resources to the stream, and close it.
writer.Close()
End Sub
End Class
--------------------------------------------------------------
不管 Dim fs As New FileStream("items.resources", _
FileMode.OpenOrCreate, FileAccess.Write)这一句已那种方式打开,
Dim writer = New ResourceWriter(fs) 这一句还是把资源文件初始化了。
比如说我第一次调用这段代码,它生成了1个items.resources文件,并在里面加了一些资源文件,我第二次运行到这段代码的时候,它也是会把items.resources初始化,这时候它只保留了第二次添加的资源文件,而第一次添加的资源文件就不见了。
我要德效果是第二次的资源文件追加在第一次的资源文件后面,可以一直把资源文件加进去,但是前面加进去的资源文件不要清空。。