|
Here is what I did. tbxCourseDate3 is YYMMDD. Example 070329.
Dim strDate As String = Mid(tbxCourseDate3.Text, 3, 4) + Mid(tbxCourseDate3.Text, 1, 2)
strDate = strDate.Insert(2, "/")
strDate = strDate.Insert(5, "/")
If IsDate(strDate) = False Then
....
Thanks for the help.
Lost in the vast sea of .NET
|
|
|
|
|
You can use the DateTime.TryParseExact method with the format string "yyMMdd" to attempt to parse the string.
---
single minded; short sighted; long gone;
|
|
|
|
|
If Mid(txtDate.Text, 3, 1) = "/" And Mid(txtDate.Text, 6, 1) = "/" Then
If Val(Mid(txtDate.Text, 7, 4)) < 1900 Or Val(Mid(txtDate.Text, 7, 4)) > 2078 Then
lblmessage.Text = "Invalid Date..."
Exit Sub
End If
If Not IsDate(Mid(txtDate.Text, 4, 3) & Mid(txtDate.Text, 1, 3) & Mid(txtDispatchDate.Text, 7, 4)) Then
lblmessage.Text = "Invalid Date..."
Exit Sub
End If
strdate = Mid(txtDate.Text, 4, 3) & Mid(txtDate.Text, 1, 3) & Mid(txtDate.Text, 7, 4)
lblmessage.Text = ""
Else
lblmessage.Text = "Invalid Date..."
Exit Sub
End If
All sorrows will be forget...,When u think ur most lovable one...,
Mag,
|
|
|
|
|
I noticed from the msdn help that posting a large message to the event
log is a bad practice. Logging a path to a file is better in this
instance. Is it possible to send a hyperlink in an event log message
that references an XML file that has a processing instruction to be
transformed by an XSLT file? I'd like the user to be able to click the
hyperlink in the event log and have a formatted html page open in a
browser.
Is this possible or is it a bad practice?
Thanks in advance,
|
|
|
|
|
|
hi
hi i want to create a setup for the application developed by me in vb.net 2005 which should ask for the license key when u try to install it
if u dono the license key the installation should be forced to abort
how to do that
pls reply asap
thank u
with regards
Balagurunathan.B
|
|
|
|
|
|
Why are you asking the same question, over and over again ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i dint get a correct reply more over that if its 24hrs late no one looks at that question so i did that
with regards
Balagurunathan.B
|
|
|
|
|
hi
hi i want to create a setup which should ask for the license key when u try to install it
if u dono the license key the installation should be forced to abort
how to do that
pls reply asap
thank u
with regards
Balagurunathan.B
|
|
|
|
|
|
Sir/Madam,
Can i programically open the outlook to send the mails in vb.net 2005 Window Applications.
Thanks And Regards
Pankaj
|
|
|
|
|
|
Hi this code in c#...,How to write in vb.net...,
string strinput;
char[] chararrinput=strinput.ToCharArray();
Byte[] arrbyteinput=new byte[chararrinput.Length-1];
specially,this line "Byte[] arrbyteinput=new byte[chararrinput.Length-1];"
becoz here they are converting that character in to byte....
how to write in vb.net
if any one knows plz help me....,
-- modified at 6:53 Thursday 29th March, 2007
-- modified at 7:33 Thursday 29th March, 2007
Magi
|
|
|
|
|
Dim strinput As String<br />
Dim chararrinput() As Char = strinput.ToCharArray<br />
Dim arrbyteinput() As Byte = New Byte(((chararrinput.Length - 1)) - 1) {}
Tirtha
"A man can ride on your back only when it is bent....."
|
|
|
|
|
ya its accepting....,
but whats the use of that open and close braces?,
with out that braces its not accepting that line......
-- modified at 7:42 Thursday 29th March, 2007
-- modified at 7:46 Thursday 29th March, 2007
Magi
|
|
|
|
|
I have developed software in Vb.Net I want to run my application when system starts. I put my Exe file in Startup and its working fine. But I want that my application run through .Ini File.
|
|
|
|
|
fahedakhter@hotmail.com wrote: But I want that my application run through .Ini File.
what do you mean ?? ini files are just a text files
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
I would guess you put the acutal exe file in the startup. I think what you want to do, is leave your exe and ini files in a folder on the c drive. Then put a shortcut to your exe in startup. That way your exe will be running in that folder with your ini file.
Hope that helps.
Ben
|
|
|
|
|
fahedakhter@hotmail.com wrote: my application run through .Ini File
You don't run an application through an INI file. Rather you would initialize values to the application. Is that you are intending to ask?
|
|
|
|
|
Hi i want encryption codes and decryption codes in vb.net....,
Plz help me
-- modified at 4:51 Thursday 29th March, 2007
Magi
|
|
|
|
|
Have a look to MSDN for Cryptographic Services [^]
There are samples.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hi i need codes...,
If u have plz share with me....,
Magi
|
|
|
|
|
Here is code that is how you can encrypt and decrypt any strings. I didn't write it but got from one of other codeproject.com members. It is working fine. If you get any error message, you should consider in using different ENCRYPT_KEY or ENCRYPT_VECTOR until the error message disappears. I assume that you know how to use a class sample inside code. I have given you a sample below how to use it.
Dim MyEncryption as Encryption
Dim EStr as String = "Fish can't think but fish knows everything"
Messagebox.show("Encrypted Format:" + MyEncryption.toBase64(Estr))
Messagebox.show("Decrypted Format:" + MyEncryprion.toBase32(Estr))
Imports System.Text
Imports System.Security.Cryptography
Public Class Encryption
#Region "Public Routines"
const ENCRYPT_KEY AS STRING = "TEST"
const ENCRYPT_VECTOR AS STRING = "CODEPRJT"
Public Shared Function ToBase64(ByVal sDataToEncrypt As String) As String
Dim stream As System.IO.MemoryStream = New System.IO.MemoryStream
Dim key As Byte() = Encoding.Default.GetBytes(ENCRYPT_KEY.PadRight(24, Chr(0)))
Dim Vector As Byte() = Encoding.Default.GetBytes(ENCRYPT_VECTOR.PadRight(8, Chr(0)))
Dim des As TripleDESCryptoServiceProvider = New TripleDESCryptoServiceProvider
Dim cryptoStream As CryptoStream = New CryptoStream(stream, des.CreateEncryptor(key, Vector), CryptoStreamMode.Write)
Dim Input() As Byte = Encoding.Default.GetBytes(sDataToEncrypt)
cryptoStream.Write(Input, 0, Input.Length)
cryptoStream.FlushFinalBlock()
Return Convert.ToBase64String(stream.ToArray())
End Function
Public Shared Function ToBase32(ByVal sDataToDecrypt As String) As String
Dim stream As System.IO.MemoryStream = New System.IO.MemoryStream
Dim key As Byte() = Encoding.Default.GetBytes(ENCRYPT_KEY.PadRight(24, Chr(0)))
Dim Vector As Byte() = Encoding.Default.GetBytes(ENCRYPT_VECTOR.PadRight(8, Chr(0)))
Dim des As TripleDESCryptoServiceProvider = New TripleDESCryptoServiceProvider
Dim cryptoStream As CryptoStream = New CryptoStream(stream, des.CreateDecryptor(key, Vector), CryptoStreamMode.Write)
Dim Input() As Byte = Convert.FromBase64String(sDataToDecrypt)
cryptoStream.Write(Input, 0, Input.Length)
cryptoStream.FlushFinalBlock()
Return Encoding.Default.GetString(stream.ToArray())
End Function
#End Region
End Class
-- modified at 6:53 Thursday 29th March, 2007
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
sorry yar i didnt get...,
I am getting encrption itself error...
for this i want to add any reference..........?
Magi
|
|
|
|