【开源】将RES中的资源写到文件
<font face="Verdana">'将资源写出到指定文件<br/>Function WriteToFile(资源标识, cFile As String)<br/>Dim Tmpfile() As Byte<br/> '将资源文件装入内存<br/> Tmpfile = LoadResData(资源标识, "CUSTOM")<br/> Open cFile For Binary As #1<br/> Put #1, , Tmpfile<br/> Close #1<br/>End Function</font><font face="Verdana">'将资源写出到指定文件</font> <font face="Verdana">Function ParseResourceFile(ByVal FilePath As String, ByVal FileName As String, ByVal ResType As String, ByVal ResID As Integer, ByVal IfDeleteFile As Boolean) As Boolean<br/> <br/> Dim TempFile() As Byte<br/> Dim PathName As String<br/> Dim intFreeFile As Integer<br/> <br/> <br/> If Right(FilePath, 1) <> "\" Then FilePath = FilePath + "\"<br/> PathName = FilePath + FileName<br/> <br/> If Len(Dir(PathName)) Then<br/> If IfDeleteFile Then<br/> Kill PathName<br/> Else<br/> Exit Function<br/> End If<br/> End If<br/> <br/> TempFile = LoadResData(ResID, ResType)<br/> intFreeFile = FreeFile()<br/> Open PathName For Binary Access Write As #intFreeFile<br/> Put #intFreeFile, , TempFile<br/> Close #intFreeFile<br/> <br/> Erase TempFile<br/> ParseResourceFile = True<br/> <br/>End Function</font>
页:
[1]