Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
Option Explicit
Private Enum idCodePage
win = 1251
Dos = 866
Koi = 20866
Iso = 28595
End Enum
Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpMultiByteStr As String, ByVal cchMultiByte As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long) As Long
Private Declare Function WideCharToMultiByte Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, ByVal lpWideCharStr As Long, ByVal cchWideChar As Long, ByVal lpMultiByteStr As String, ByVal cchMultiByte As Long, ByVal lpDefaultChar As Long, ByVal lpUsedDefaultChar As Long) As Long
Private Const CP_ACP As Long = 0&
Private Const CP_OEMCP As Long = 1&
Private Sub Form_Load()
Dim pathIn As String
Dim pathOut As String
Dim src As String
Dim dst As String
Dim l As Long
Dim ff As Integer
pathIn = "c:\1 1\dos.txt"
pathOut = "c:\1 1\win.txt"
' читаем исходный файл
ff = FreeFile()
Open pathIn For Binary As #ff
l = LOF(ff)
src = String$(l, vbNullChar)
Get #ff, , src
Close #ff
'переконвертируем
'dst = ConvertCodePage(src, Win, Dos)
dst = ConvertCodePage(src, Dos, win)
'удаляем файл назначения, если существует
If Dir$(pathOut) <> vbNullString Then Kill pathOut
'записываем новый файл
ff = FreeFile()
Open pathOut For Binary As #ff
Put #ff, , dst
Close #ff
Unload Me
End Sub
Private Function ConvertCodePage(src As String, inPage As idCodePage, outPage As idCodePage) As String
Dim buf As String
Dim dst As String
Dim size As Long
size = MultiByteToWideChar(inPage, 0&, src, Len(src), 0&, 0&)
buf = String(size, Chr$(0))
size = MultiByteToWideChar(inPage, 0&, src, Len(src), StrPtr(buf), Len(src))
size = WideCharToMultiByte(outPage, 0&, StrPtr(buf), size, ByVal 0&, 0&, 0&, 0&)
dst = String(size, Chr$(0))
size = WideCharToMultiByte(outPage, 0&, StrPtr(buf), size, dst, Len(src), 0&, 0&)
If size <> 0 Then ConvertCodePage = Left$(dst, size)
End Function
Отлично,интерактивное меню на ура.Посмотри на мой проект.