Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Loadĭim result As Integer = GetPrivateProfileStringW("Service", "Service Name", "", sb, sb.Capacity, "setup.ini")ĭim ex As New Win32Exception(Marshal.GetLastWin32Error()) Private Declare Auto Function GetPrivateProfileStringW Lib "kernel32" (ByVal lpAppName As String, You need to add a W to the name, which makes the corrected code: ' With these imports Private Function getIniValue(iniFileInstance As IniFile, sectionName As String, sectionKey As String) As Stringįor Each sect As IniFile.IniSection In iniFileInstance.Sectionsįor Each key As In sect.KeysĪs an alternate, the code for the original approach is very close to correct, but GetPrivateProfileString doesn't actually exist in Kernel32.dll. MessageBox.Show(String.Concat("Something went wrong:", ex.Message)) Sybase Directory= C:\Program Files\SQL Anywhere 16įireDAC=DB=asa16 eng=ENGINE dbn=DBNAME links=TCPIP]", myValue)) Sybase Adaptive Server Anywhere Client=Yes I'm trying to read a INI file then dump the values into the registry for a setup application to function.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |