Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27226

VS 2010 Reading and Writing to my .ini file

$
0
0
hi,

i'll post the reading problem later, rite now i have an error on writing to .ini file, here's my code:

Code:

Imports System
Imports System.Xml

Public Class Editor

    Private Sub Editor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        slctForced.SelectedIndex = 0
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        'XML Test http://pastebin.com/ycXFJ8gzhttp://pastebin.com/ycXFJ8gz
        Dim writeFile As New System.IO.StreamWriter(Application.StartupPath - +"/Start/InstallCFG.ini", True)

        Dim Add As String =
                        "Install Order:" + CInt(txtOrder.Text).ToString() + Environment.NewLine +
                        "App Name:" + txtAppName.Text + Environment.NewLine +
                        "Description:" + txtDesc.Text + Environment.NewLine +
                        "App File:" + txtFile.Text + Environment.NewLine +
                        "Forced:" + slctForced.Text + Environment.NewLine +
                        "Support URL:" + txtUrl.Text + Environment.NewLine +
                        "Screenshot:" + txtScreenshot.Text + Environment.NewLine +
                        "#####################################################################" + Environment.NewLine + Environment.NewLine

        writeFile.Write(Add)
        writeFile.Close()
        MessageBox.Show(MessageBoxIcon.Information, "Succesfully saved " + txtAppName.Text + " to file!")
    End Sub

    Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Hide()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OFD.ShowDialog()
        'OFD.FileName = "App Setup File || .exe, .msi, .cmd/.bat or a .reg file..."
        txtFile.Text = OFD.FileName
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        OFD.ShowDialog()
        'OFD.FileName = "App Screenshot || .jpg, gif, .bmp or .png images."
        txtFile.Text = OFD.FileName
    End Sub

End Class

and here's the error: Conversion from string "H:\X17-59183\PostInstall\PostIns" to type 'Double' is not valid.

can any1 help n me solve this...

Viewing all articles
Browse latest Browse all 27226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>