vijay

welcome Netizen

Share Your Knowledge.It is a way to achieve immortality

Friday, March 25, 2011

How to Create a log file(.txt) in vb.Net?


hi..
Introduction:
Here i can describe how to create an log file(.txt) in vb.net ,By using this log file you can store event information or login time ,lout time any informations you can store into log file

Description:

For an examble if you want store user login information,
First you can store the login  information in to an  variable  and then follow this steps..


Add one new  button and write this code....
    Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
source="c:\log"  'Going to create a Directory
 If not Directory.Exists(source) Then   'Checking Directory Exist or Not
Directory.CreateDirectory(source) 
  MsgBox("New Directory Created", MsgBoxStyle.Information)
end if
Dim filelocation as string =source & "file.txt"
  Dim fs As New FileStream(filelocation, FileMode.Create, FileAccess.Write)
 Dim writer As New StreamWriter(fs)
writer.writeline("mention login time") 'Here mention store variable  login time
writer.writeline("mentionlogouttime")
writer.close()
end sub 
By using this you can easily create a file and directory in vb.net
i Hope this one Helpful  2 u..............................

Sunday, March 13, 2011

How to insert a new row in a Datatable in vb.Net..


hi...

Here i am describe how to insert a new row in a datatable using vb code
In my application  i need an requirement to insert a new row into datatable after getting the data from the database.
i googled but i didnt get the proper result for my need ,after deep search i found the result ,
By using this code you can insert new row at any position in the datatable...

For an examble if you want to insert a new row in 0th postion ..let see the code

Dim dr as  datarow


dr = dt.NewRow()
        For j = 0 To dt.Columns.Count - 1


            Select Case j
                Case 0
                    dr("column1") = "Name"
                Case 1
                    dr("column2") = " Number"
                Case 2
                    dr("column3") = "Address"
            End Select
        Next


        dt.Rows.InsertAt(dr, 0)  'Here 0 denotes postion of the row to insert....

i hope this one helpfull to u.....

Wednesday, March 2, 2011

Google Introduce a new Search Engine called BLACKLE


Google Introduce a new Search Engine called BLACKLE

hi..
Its very intresting ,New search engine same like an google,But they developer change the theme,everything would be black..
If you are searching by using BLACKLE,you can save energy one search at atime..
please check out this site it was very intresting...

www.blackle.com


Tuesday, March 1, 2011

How to Blink a label in an form using VB.NET?


INTRODUCTION:

In this articles i give some tips to make a form more attractive,By using this type of technique you can easily attract customers..
when i googled i found this easy methods to blink a label in an form.

Description:
For that you have to add one time control to your form and follow this code....

Enter in from load...
 Private Sub startprocess_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 500
        Timer1.Start()
    End Sub



 Private Sub InitTimer()
        Dim timer As New Timer()
        timer.Interval = 3000
        AddHandler timer.Tick, AddressOf Blink
        timer.Start()
    End Sub




    Private Sub Blink(ByVal sender As Object, ByVal e As EventArgs)
        Dim visible As Boolean = Label1.Visible
        If visible Then
            Label1.Visible = False
        Else
            Label1.Visible = True
        End If
    End Sub



Enter this one  timer click ..


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Visible = Not Label1.Visible
    End Sub

i hope this one helpful to you ..even if you know any easy methods to do.. plz share with us......