Archive for VB.NET

Comparing 2 Dates

Posted in Coding, VB.NET with tags , on 10 October 2008 by harisanto

I discovered a very interesting little twist on the differences between the Today property and the Now property in the DateTime Class. I was working on something recently and using the built-in Compare method of the DateTime Type. Essentially the user selected a date and I had a validation snippet that was supposed to check that they had not picked a future date. One of the ways they could choose their date was via a DateTimePicker control. I thought that this code might do the trick:

Dim EndDate As DateTime
Dim Current As DateTime = Today

If DateTime.Compare(Current, EndDate) < 0 then
    label6.text ="" "CONTRACT EXPIRED LESS THAN"
end if
if datetime.compare(current, enddate) ="" 0 then
    label6.text ="" "CONTRACT EXPIRED EQUALS"
end if
if datetime.compare(current, enddate) > 0 Then
    Label6.Text = "CONTRACT NOT EXPIRED GREATER"
End If

Mengambil Informasi Applikasi

Posted in Coding, VB.NET with tags , , on 23 September 2008 by harisanto
My.Application obyek adalah pusat informasi yang dengan cepat dapat anda dapatkan. Mengambil informasi dari sana dapat semudah anda menariknya dari system properti.

Memakai My.Application adalah salah satu cara untuk mengambil versi, lokasi dan parameter yang anda gunakan untuk applikasi anda.

Read more »