i have login form which is form2
i have another form which is form1
the form1 should come only once that to when i install this application in the new machine after that it should not come again only thing is when we click on the linkedlabel which is in form2 it will call form1
how to do in order to get the form1 only once, when we install into a new machine

Recommended Answers

All 6 Replies

hello skp03 !
i think u have to use xml file. when u run ur application first time then a form1 is load first, put ur code to chk that the xml file is present in directory if yes then hide the form and load the form2 , and also create the file , next time when ever u run ur application ur form1 chk that file is present form1 quickly load form2 and hide it self ,this is not the ideal solution , but i think it will work fine
Hope This Will helps You

Best Regards
M.Waqas Aslam

there is may b another solution of ur prob is to change the project start up form ,i dnt knw is this is possible or not , but try to search this method , and if u find any solution please let me knw ,

Regards
M.Waqas Aslam

there is may b another solution of ur prob is to change the project start up form ,i dnt knw is this is possible or not , but try to search this method , and if u find any solution please let me knw ,

Regards
M.Waqas Aslam

see i have created a loginform in which their is a admin password as the password is matched the admin will be allowed to acess
in order to reset the password what shall i do please guide me

in this no database is used

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        System.Diagnostics.Process.Start("chrome.exe")

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        System.Diagnostics.Process.Start("WINWORD.exe")

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

        System.Diagnostics.Process.Start("notepad.exe")

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try

            If TextBox1.Text = "topsecret" Then

                Form2.ShowDialog()


            End If

        Catch ex As Exception

            MsgBox("Invalid Password", MsgBoxStyle.OkOnly, "Ok")

        End Try
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

    End Sub
End Class

in the above code just see how can i reset the password while it is executing and it should save the new one please help

hello skp03 !
i think u have to use xml file. when u run ur application first time then a form1 is load first, put ur code to chk that the xml file is present in directory if yes then hide the form and load the form2 , and also create the file , next time when ever u run ur application ur form1 chk that file is present form1 quickly load form2 and hide it self ,this is not the ideal solution , but i think it will work fine
Hope This Will helps You

Best Regards
M.Waqas Aslam

how to use xml file please help

hello skp03 !
bro u can use this code to write ur xml file

Imports System.Xml
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim writer As New XmlTextWriter("product.xml", System.Text.Encoding.UTF8)
        writer.WriteStartDocument(True)
        writer.Formatting = Formatting.Indented
        writer.Indentation = 2
        writer.WriteStartElement("Table")
        createNode(1, "Product 1", "1000", writer)
        createNode(2, "Product 2", "2000", writer)
        createNode(3, "Product 3", "3000", writer)
        createNode(4, "Product 4", "4000", writer)
        writer.WriteEndElement()
        writer.WriteEndDocument()
        writer.Close()
    End Sub
    Private Sub createNode(ByVal pID As String, ByVal pName As String, ByVal pPrice As String, ByVal writer As XmlTextWriter)
        writer.WriteStartElement("Product")
        writer.WriteStartElement("Product_id")
        writer.WriteString(pID)
        writer.WriteEndElement()
        writer.WriteStartElement("Product_name")
        writer.WriteString(pName)
        writer.WriteEndElement()
        writer.WriteStartElement("Product_price")
        writer.WriteString(pPrice)
        writer.WriteEndElement()
        writer.WriteEndElement()
    End Sub
End Class

hope this will helps u
Regards
M.Waqas Aslam

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.