• 쇼핑몰
  • 커뮤니티
  • 북마크

vb.net




[기타] [vb.net] 리소스(Resources) 파일로 저장하기

하나를하더라도최선을
2020.05.06 19:56 794 0

본문



        Dim resSet As Resources.ResourceSet = My.Resources.ResourceManager.GetResourceSet(Globalization.CultureInfo.InvariantCulture, TrueFalse)
        For Each de As DictionaryEntry In resSet
            Dim key As String = de.Key
            If key.IndexOf("_"= 0 Then key = key.Substring(1)
            Dim fPath As String = String.Concat(MyDocuments, Application.ProductName, "\User Data\", key)
            If Not System.IO.File.Exists(fPath) Then
                Dim O As Object = My.Resources.ResourceManager.GetObject(de.Key)
                Select Case My.Resources.ResourceManager.GetObject(de.Key).GetType
                    Case GetType(System.String)
                    Case GetType(System.Drawing.Icon)
                    Case Else
                        Dim B() As Byte = O  '// System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(de.Key)
                        Dim ResourceFile As New System.IO.FileStream(String.Concat(MyDocuments, Application.ProductName, "\User Data\", key), IO.FileMode.Create)
                        ResourceFile.Write(B, 0, B.Length - 1)
                        ResourceFile.Flush()
                        ResourceFile.Close()
                End Select
            End If
        Next
 


댓글목록 0

등록된 댓글이 없습니다.