Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[VB.NET] INI-Datei auslesen

Empfohlene Antworten

Veröffentlicht

huhu, ich bins mal wieder ;)

hab da ein neues problem.

ich möchte gerne eine ini auslesen mit dem code

    Public Function GetIniString(ByVal Sektion As String, _

  ByVal Titel As String, ByVal Vorgabe As String, _

  ByVal INIFile As String, _

  Optional ByVal nSize As Integer = 256) As String


        Dim lResult As Long

        Dim sValue As String


        sValue = Space(nSize)

        lResult = GetPrivateProfileString(Sektion, Titel, _

          Vorgabe, sValue, nSize, INIFile)

        GetIniString = Left$(sValue, lResult)

    End Function

leider bekomme ich am ende (getinistring) eine overflow exeption mit dem wert "8589934592".

ich habe keine erklärung dafür.

ich hoffe einer von euch weiß rat.

unter visual studio 2008 funzt das einwand frei aber ich arbeite mit visual studio 2010 und tritt das prob auf.

danke schon mal!

gruß michael

Bearbeitet von Michael_M

auch das funzt nicht. ich bekomme immer die gleich fehlermeldung.

ich hab auch schon IResult als integer, int64 und short probiert. immer das gleiche. :(

vorallem bin ich verwundert, das es unter vs2008 klappt aber unter vs2010 nicht.

[DllImport("kernel32")]

private static extern int GetPrivateProfileString(string section,

string key, string def, StringBuilder retVal, int size, string filePath);

das vorvorletzte argument sollte ein stringbuilder sein und kein string

evtl liegts an dem...

hab nu ne andere variante gewählt (settings von visual studio), bei der ich leider wieder auf ein problem gestoßen bin.

und zwar kann ich die einträge nicht mehr ändern.

meine versuche sehen so aus

        If Len(TextBox_server.Text) <> 0 Then

            My.Settings.s_server.Replace(My.Settings.s_server, TextBox_server.Text) 'keine wirkung

            'My.Settings.s_server = TextBox_server.Text                             'geht nicht, da read only

            My.Settings.Save()

            TextBox_server.Clear()

        End If

hat jemand ne idee, was da falsch läuft bzw hat ne andere lösung!

micha

ja, ist application setting. das read only wurde automatisch gemacht.

aber genau das war das prob. hab die nu auf user gestellt und es funzt wunderbar.

danke!!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.