Showing posts with label apps. Show all posts
Showing posts with label apps. Show all posts

Sunday, 22 July 2012

kill and start program in vb.net

The following VB.NET program allows starting multiple calculator applications and later it kills the same instances of all calculator applications.

The Process component is a useful tool for starting, stopping, controlling, and monitoring applications. A process is a running application and a thread is the basic unit to which the operating system allocates processor time. Using the Process component, you can obtain a list of the processes that are running, or you can start a new process.

GetProcessesByName(String) - Creates an array of new Process components and associates them with all the process resources on the local computer that share the specified process name.

  Dim _proceses As Process()
  _proceses = Process.GetProcessesByName("calc")

The above syntax retrieve all the process associated with "calc" application in the _proceses array. System.Diagnostics provides access to local and remote processes and enables you to start and stop local system processes.

Download Source CodePrint Source Code
Public Class Form1

                Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                                System.Diagnostics.Process.Start("calc")
                End Sub

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

                                Dim _proceses As Process()
                                _proceses = Process.GetProcessesByName("calc")
                                For Each proces As Process In _proceses
                                                proces.Kill()
                                Next

                End Sub

End Class

Friday, 20 July 2012

get computer name,os name or user name in vb.net

In this Tutorial, I’m discourse cover how to obtain pieces of information about your computer or get os name, compter name etc . I will show you how to create a simple application that shows you different pieces of information about your computer. This can be very useful when you begin developing more advanced applications. Then you can add additional features for your application

Copy and paste below Code:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = My.Computer.Name
        TextBox2.Text = My.User.Name
        TextBox3.Text = My.Computer.Info.OSFullName
        TextBox4.Text = My.Computer.Keyboard.CapsLock
        TextBox5.Text = My.Computer.Mouse.WheelExists
        TextBox6.Text = My.Computer.Screen.WorkingArea.ToString
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Clear()
        TextBox2.Clear()
        TextBox3.Clear()
        TextBox4.Clear()
        TextBox5.Clear()
        TextBox6.Clear()
    End Sub

End Class

Auto typer in vb.net

This tutorial will teach you how to make your very own Auto Typer.
 Auto Typers are popular across the web and in some cases people charge money for them.
 With this easy tutorial, you can create your own customizable Auto Typer and share it with your friends.

Copy and paste Code Below :

Public Class Form1

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        SendKeys.Send(TextBox1.Text)
        SendKeys.Send("{Enter}")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Interval = TextBox2.Text * 1000
        Timer1.Start()
    End Sub

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

End Class

Thursday, 14 June 2012

Get Mac address of your computer in vb.net?



Get Mac address of your computer 

What is Mac(Media Access Control) more details wiki
Get software to change Mac Address your computer Mac
To get Mac address of your do like this
One button
Copy the code below
ImportsSystem.Net.NetworkInformation

Public Class Form1

    Private Sub Button1_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesButton1.Click
        Try
            ForEach nic AsSystem.Net.NetworkInformation.NetworkInterfaceIn System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces
                MessageBox.Show(String.Format("the mac address of {0} is{1}{2}", nic.Description, Environment.NewLine, nic.GetPhysicalAddress()))
            Next
        Catchex As Exception
            MessageBox.Show(ex.Message.ToString)
        End Try
    End Sub


End Class


Saturday, 28 January 2012

How to combine two names in vb.net?


How to combine two names in vb.net?
In this tutorial you can make text as lower case and upper case
Step1:
Open Microsoft visual studio
Step2:
Select file new à windows form application à rename it as combine text
Step3:
Drag and drop the
Three text box
Three labels change the label properties, and form properties
One button
Step4:
Write the below code in program window
 Public Class Form1
    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        TextBox3.Text = TextBox1.Text & " " & TextBox2.Text
        TextBox4.Text = TextBox3.Text.ToUpper
        TextBox5.Text = TextBox3.Text.ToLower
    End Sub
End Class

Output:

How to make your own digital clock in vb.net?


How to make your own digital clock in vb.net?
In this tutorial you can make digital clock with use of timer
Step1:
Open Microsoft visual studio
Step2:
Open file new àwindows form application à rename it as my own clock
Step3:
Drag and drop the three textbox, four labels, one timer
Step4:
Write or copy the below code
Code:
Public Class Form1
    Private SubTimer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesTimer1.Tick
        TextBox3.Text = TextBox3.Text + 1
        If TextBox3.Text = "60"Then
            TextBox3.Text = "00"
            TextBox2.Text = TextBox2.Text + 1
            If TextBox2.Text = "60"Then
                TextBox2.Text = "00"
                TextBox1.Text = TextBox1.Text + 1
                If TextBox1.Text = "13" Then
                    TextBox1.Text = "01"
                End If
            End If
        End If
    End Sub
    Private SubForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
        Timer1.Start()
        TextBox1.Text = Now.Hour
        TextBox2.Text = Now.Minute
        TextBox3.Text = Now.Second
        If TextBox1.Text >= "00"Then
            Label4.Text = "AM"
        ElseIf TextBox1.Text <= "12"Then
            Label4.Text = "PM"
        End If
    End Sub
End Class

Output:

Wednesday, 25 January 2012

How to speech text in vb.net?

How to speech text in vb.net?
Step1:
Open Microsoft visual studio
Step2:
Click file new àwindows form application àrename it as speech text
Step3:
Drag and drop the one textbox, button from tool box
Step4:
Change text box anchor properties

Step5:
Write the below code on your program window
Public Class Form1

    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click

        Dim Speech

        Speech = CreateObject("SAPI.spvoice")

        Speech.Speak(TextBox1.Text)

    End Sub

End Class


Output:

click the speech button to speech




Tuesday, 24 January 2012

How to read text file in vb.net?


How to read text file in vb.net?
Step1:
Open Microsoft visual studio.
Step2:
File ànew project àselect the windows form application à rename it as text file reader
Step3:
Drag and drop two Button, open file dialog, and list box from tool box
Step4:
Change properties for list box and form
for list box, and form:




Step5:
Copy the below code:
Public Class Form1

    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        Using FD As New OpenFileDialog()
            FD.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
            If FD.ShowDialog = Windows.Forms.DialogResult.OK Then
                ListBox1.Items.Clear()
                ListBox1.Items.AddRange(IO.File.ReadAllLines(FD.FileName))
            End If
        End Using
    End Sub
  
    Private SubButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton2.Click
        Close()
    End Sub
End Class

 Output:


Saturday, 21 January 2012

How to make log in form in vb.net


How to create login form in vb.net?
Step1:
Open Microsoft visual studio.
Step2:
File ànew project àselect the windows form application à rename it as password
Step3:
Drag and drop Button1, two text box, three labels from tool box
Step4:
Double click the button copy the code:
Public Class Form1

    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        If TextBox1.Text = "hemanth"Then
            If TextBox2.Text = "12345"Then
                Label3.Text = "login sucessfull.."
            Else
                Label3.Text = "wrong user namee or password."
            End If
        End If
    End Sub
End Class

Output:


How to use the progress bar in vb.net


How to use progress bar in vb.net?
Step1:
Open Microsoft visual studio.
Step2:
File ànew project àselect the windows form application à rename it as progress bar
Step3:
Drag and drop Button, progress bar from tool box
Step4:
Change the properties of progress bar.
 to this


Double click the button1 copy the code
Public Class Form1
    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        ProgressBar1.Value = ProgressBar1.Value + 100
        If ProgressBar1.Value = 1000 Then
            Close()
        End If
    End Sub
End Class
 output:

how to use if statement in vb.net


How to use if statement in vb.net?
If Statements helps to decides, what to do in a given situation
To know more about if statement do this
Step1:
Open Microsoft visual studio
Step2:
File ànew project àselect the windows form application àrename it as if ststement
Step3:
Drag and drop Button, textbox1
Step4:
Double click the button1 copy the code
Code:  
Public Class Form1

    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        If TextBox1.Text = "123"Then
            ' if the textbox1.text="123" condition is correct then shows this
            MessageBox.Show("hi...! ")
        Else
            ' if the textbox1.text="else"condition is incorrect then shows this
            MessageBox.Show("bye..!")
        End If
    End Sub
End Class
                                                            If the condition is correct:

If the condition is incorrect:







Friday, 20 January 2012

calculator in vb.net


How to make your own calculator in vb.net?
Step1:
Open Microsoft visual studio
Step2:
File ànew project àselect the windows form application àrename it as calculator
Step3:
Drag and drop
Textbox1, textbox2, label1
Button1
+
Button2
-
Button3
/
Button4
*
Button5
1/x
 Change the font style for all buttons if you need
Code:
Public Class Form1
    Private SubButton1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        Label1.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
    End Sub

    Private SubButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton2.Click
        Label1.Text = Val(TextBox1.Text) - Val(TextBox2.Text)
    End Sub

    Private SubButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton4.Click
        Label1.Text = Val(TextBox1.Text) / Val(TextBox2.Text)
    End Sub

    Private SubButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton3.Click
        Label1.Text = Val(TextBox1.Text) * Val(TextBox2.Text)
    End Sub

    Private SubButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton5.Click
        TextBox2.Text = ""
        Label1.Text = 1 / Val(TextBox1.Text)
    End Sub

   End Class
you can add more buttons for another operation 

Thursday, 19 January 2012

Button, Checkbox, Checkedlistbox, and Combo Box in vb.net


How to use the Button, Checkbox, Checkedlistbox, and Combo Box?
Button:
A button is a control, communicate the user with application which we click and release the button it can perform some actions
A button is get event when the mouse button, enter key, spacebar, if the button is focused
In vb.net we use like this
We can change the button name in vb.net
Button1.text =”change to name of the button”
If you need to create a application

  • Open fileà new project from file menu
  • Select windows application àrename the application as button controller  

  • Drag and drop the button from toolbox
The following code is used to show the” message box as your created a new button “button controller application:
Public Class Form1
    Private SubForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
        Button1.Text = "my new button"

    End Sub
    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        MessageBox.Show("You’re created a new button")
    End Sub

   
End Class

Checkbox:
It checks or selects the application. You can click a check box to select it and click it again to deselect it.
Rename the Check box
Checkbox. Text=”my new check box”
If you want to do

  • Open fileà new project from file menu
  • Select windows applicationà rename the application as checkbox controller  
  • Drag and drop the checkbox from toolbox
The following code is used to show the “message box as your don” checkbox controller application:
Public Class Form1

    Private SubForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load

        CheckBox1.Text = "Show"
    End Sub

    Private SubCheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesCheckBox1.CheckedChanged
        CheckBox1.Checked = True
        MessageBox.Show("your done..!")
    End Sub
End Class

Combo Box:
The Combo Box control, which lets the user choose one of several choices from list
The combo box controller command
Combobox1.Items.add (“Sunday”)
Combobox1.Items.remove (“Sunday”)
By default you can made
Combobox1.selectedItem= combobox1.item (“select”)

  • Open fileà new project from file menu
  • Select windows applicationà rename the application as combo box controller  
  • Drag and drop the combo box from toolbox
The following code is used to show the “select the day in week” application:
Public Class Form1
    Private SubForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
        ComboBox1.Text = "-select-"
        ComboBox1.Items.Add("Sunday")
        ComboBox1.Items.Add("Monday")
        ComboBox1.Items.Add("Tuesday")
        ComboBox1.Items.Add("wednesday")
        ComboBox1.Items.Add("Thursday")
        ComboBox1.Items.Add("Friday")
        ComboBox1.Items.Add("Saturday")


    End Sub
   

End Class



Tuesday, 17 January 2012

vb.net code for my own web browser


How to make my own browser in vb.net code?
Steps to create a random number generator
Step1:  File new project ->windows forms application -> rename my browser
Step2:  Drag and drop the five buttons, one textboxes, and web browser from tool box and click web browser properties. Change the anchor options

Step3:  Rename button1 as go, button2 as stop, button3 as back, button4 as forward, button5 as exit
Step4: Double click the go button 
Write the code:
      Private SubButton1_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) HandlesButton1.Click
        WebBrowser1.Navigate(TextBox1.Text)
        If TextBox1.Text = ""Then
            MessageBox.Show("enter the  url...! ")
        End If
    End Sub
Private Sub Button2_Click(ByVal sender AsSystem.Object, ByVale As System.EventArgs) _ Handles Button2.Click
        WebBrowser1.Stop()
    End Sub
    Private SubButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _  HandlesButton3.Click
        Close()
    End Sub
    Private SubButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ HandlesButton4.Click
        WebBrowser1.GoForward()
    End Sub
    Private SubButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ HandlesButton5.Click
        WebBrowser1.GoBack()
    End Sub
    Private SubWebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As _ System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
    End Sub
    Private SubButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ HandlesButton6.Click
        Close()

    End Sub
 Step5: Run the application