|
Actually it's even easier
'Date to test
Dim stringDate As String = "sep 07"
'Date object
Dim parsedDate As Date
'If our string is valid date show days in month
If Date.TryParse(stringDate, parsedDate) Then
MsgBox(Date.DaysInMonth(parsedDate.Year, parsedDate.Month))
End If
From what I can tell the 'TryParse' method will except 3 letter abbreviations for the month as well as the full name. It won't except 'sept' however so I hope that's not an issue. If it is you could do it a little differently by making your own enumerator.
Private Function Days(ByVal text As String) As Integer
Dim split As String() = text.Split
'An error could occur so catch it and return -1
Try
Dim month As Integer = [Enum].Parse(GetType(Month), split(0).ToUpper)
Dim year As Integer = CInt("20" & split(1))
Return Date.DaysInMonth(year, month)
Catch ex As Exception
Return -1
End Try
End Function
Private Enum Month
JAN = 1
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEPT
OCT
NOV
DEC
End Enum
|
|
|
|
|
Thanks A lot it was working very nice. thanks for all the others for your reply. thanks
|
|
|
|
|
Hi there!
Just I want to know how to add excel file data into Oracle Database table using VB6.0?
I appreciate if any one there to help me asap.
thanks and regards
M. YASEEN
|
|
|
|
|
use this link and get idea from this example
ww.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=9042&lngWId=4
|
|
|
|
|
I would like to write a program that tells me how long my computer has been running and write this to a text file. I have found out browsing msdn that you need to use "Systemuptime" but does not give any SIMPLE WAY of doing this.
Would appreciate someone showing me the light at the end of the tunnel, so i can find my way home.
|
|
|
|
|
|
Thanks for the reply,
After a bit of research I got it to do want i want .
Now i can get on with the next bit.
|
|
|
|
|
How can i run my application in safe mode? Do i need to create service? If true then please can anyone send me sample service becose i have never bin working with any of them.
Thanks...
|
|
|
|
|
Uhhh...What do you mean "Safe Mode"?? Windows doesn't have a safe mode that you can run just one application in. It runs the entire O/S in safe mode, meaning stripped down, only the basic essentials and generic drivers for the basics.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave.K. be a friend!
You know what i mean if i asked that i have to create a service, i need that it runs in safe mode like in windows so i enter safe mode and my application starts up automatically...
Understand?
Thanks... Dave.K.
|
|
|
|
|
No. All services in Windows, that are not essential to running Windows in Safe Mode do not start. AFAIK, you'll have to start it manually in Safe Mode. Why is this even a concern when Safe Mode is rarely ever used??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i am building an security program that locks system untill you enter password buth if you go to safe mode you can delete it from startup and enter the windows... please help me...
|
|
|
|
|
There is nothing you can do to prevent this. The only way you're going to get any near this kind of functionality is to replace MSGINA.DLL with your own implementation. Sorry, can't be done (nicely!) in VB.NET...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
do you have sample of this or can you tell me how to do it?
|
|
|
|
|
Nope. Every example you're going to find, the few that do exist, will be in C++. Like I said, you really can't do that in VB.NET.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Besides, if all your "security" app is is a service, it's not going to protect much. At least, no different than turning on the password option on the ScreenSaver tab.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well thanks...
|
|
|
|
|
How to add new item to combo box at code behind ?
Best regards,
Chee ken
|
|
|
|
|
Hi Chee ken,
Try
ComboBox1.Items.Add("blablabla")
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks for reply. The item add sucessfully. Can i ask one more question, how to assign the value for it ? or its value is -1? And why it not show while the program load ( it locate at the second item at the drop down list and the first one is blank ) ? thanks.
Best regards,
Chee ken
|
|
|
|
|
The .Add method will usually put the value at the end of the list. If you want to add the item at a specific point in the list, use:
<br />
dim YourIndexNumber as Integer<br />
'Determine here at what position you want to insert your value, <br />
'and assign this position's index number to YourIndexNumber.<br />
'Index starts at 0<br />
ComboBox1.Items.Insert(YourIndexNumber , "blablabla")<br />
I am sorry, but I don't quite understand the second part of your question.
-- modified at 4:29 Friday 9th February, 2007
My advice is free, and you may get what you paid for.
|
|
|
|
|
And what hapend when combobox source is a table?. Necesary you must insert into that table the new item then. In addition you must refresh the combobox after. ¿What do you think?.
Thanks.
|
|
|
|
|
It depends on two things:
1. do you use databinding between the table and combobox?
If you do, then yes, you would need to insert the entry into the table and refresh the databinding.
If you fill the combobox with your own code though, and just use the table as a source, you could insert the entry straight into the combobox.
2. do you need the entry for your combobox to be saved into the table, or does the table only contain the basic entries, and are new entries just temporary in nature?
If you need the new entries to be saved, use databinding, and write the entry into the table, rather than to the combobox.
If they are only temporary, write them straight to the combobox, and do not use databinding.
Is that what you meant?
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Is it possible to use the fingerprint reader in my application? As i know the fingerprint reader is for logon. Need to install any SDK or what? Can anyone help me? Thanks.
|
|
|
|
|
You can get the Fingerprint reader SDK from http://www.ipaqdeveloper.com/[^]. You'll have to register as a developer, but I think it's free.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|