|
|
Hi
I want to convert a string that is "$0.67" to number format("0.67") how i convert this. mainly i have a values with $ sign and i want to remove this $ from the string.
Please suggest how i do this.
Thanks
Mitesh
~Khatri Mitesh
khatrimitesh@hotmail.com
Bikaner (Rajasthan)
INDIA
|
|
|
|
|
|
The Replace method on the string class can replace the $ with an empty string. Then you can use double.TryParse.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Along with the other suggestions, you could try Double.Parse with the overload that takes a System.Globalization.NumberStyles and choose AllowCurrencySymbol. If you care about working for other currencies than just $, this may be your best bet.
|
|
|
|
|
i need to disable ctrl,shift,tab,windows key
is there any coding to disable them and enable them
plz help me
|
|
|
|
|
To do this across your whole computer, you need to write a system wide keyboard hook. I doubt VB can do this. To do it in your app, just ignore the keys when pressed.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I think it is possible actually, I saw an article on CP even, yep here it is Click[^]. You'll need to do some modifying but it's all there in the article comments. Just hook Keys.ControlKey etc etc etc and handle them however you want.
modified on Tuesday, December 23, 2008 9:10 AM
|
|
|
|
|
cross post[^]
C isn't that hard: void (*(*f[])())() defines f as an array of unspecified size, of pointers to functions that return pointers to functions that return void
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." - Martin Golding
|
|
|
|
|
Dear, Sir
I m Jayanta from Guwahati, India i start a program with Digital Persona Fingerprint reader its date reading section is success fully complete but its data storing section is disturbed a variable set problem if any body help me i will ever great full for all lige life.
my program code is
Dim cn As New ADODB.Connection
Dim WithEvents fpRegister As FPRegisterTemplate
Dim Template As FPTemplate 'Last template produced
Dim blob_read() As Byte
Dim blob_write() As Byte
Dim WithEvents fpGet As FPGetTemplate
Dim fVerify As FPVerify
Private Sub cmdExit_Click()
End
End Sub
Private Sub save_Click()
Dim rsUser As New ADODB.Recordset
Dim bVariant As Variant
Set fpGet = New FPGetTemplate
blob_write = ("FINGERPRINT")
bVariant = Null
If Template Is Nothing Then
MsgBox "Nothing Registered !!"
Exit Sub
End If
If txtUserCode = "" Then
MsgBox "Please enter UserCode", vbInformation
Exit Sub
End If
If txtUserName = "" Then
MsgBox "Please enter Username", vbInformation
Exit Sub
End If
Template.Export bVariant
blob_write = bVariant
rsUser.Open "select * from FP where ID='" & Trim(txtUserCode) & "'", cn, adOpenKeyset, adLockOptimistic
If rsUser.EOF Then
rsUser.AddNew
End If
rsUser!id = txtUserCode
rsUser!Name = txtUserName
rsUser!Fingerprint = blob_write
rsUser.Update
Set rsUser = Nothing
End Sub
Private Sub Form_Load()
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\FINGER.mdb;Persist Security Info=False"
optRegister_Click
End Sub
Private Sub Form_Resize()
Me.Width = 6345
Me.Height = 4410
End Sub
Private Sub fpGet_Done(ByVal pTemplate As Object)
Dim rsUser As New ADODB.Recordset
Set tp = pTemplate
Dim rp As FPTemplate
Set fpGet = New FPGetTemplate
Set fVerify = New FPVerify
Dim result As Boolean
result = False
rsUser.Open "select * from fp", cn, adOpenKeyset, adLockOptimistic
Do While Not rsUser.EOF
blob_read = rsUser("fingerprint")
varnt = blob_read
Set rp = New FPTemplate
er = rp.Import(varnt)
re = fVerify.Compare(rp, pTemplate, result, src, thsh, False, Sm_None)
If result = True Then Exit Do
Set rp = Nothing
rsUser.MoveNext
Loop
If result = False Then
MsgBox "User Fingerprint Not match !! you must register", vbInformation
Else
MsgBox "User Code : " & rsUser!usercode & vbNewLine & "User Name : " & rsUser!Name
cn.Execute "insert into logs(usercode,logtime) values ('" & rsUser!usercode & "',#" & Now & "#)"
End If
Set rp = Nothing
Set fpGet = Nothing
Set fVerify = Nothing
optRegister_Click
End Sub
Private Sub fpGet_SampleReady(ByVal pSample As Object)
pSample.PictureOrientation = Or_Portrait
pSample.PictureWidth = picFingerprint.Width / Screen.TwipsPerPixelX
pSample.PictureHeight = picFingerprint.Height / Screen.TwipsPerPixelY
picFingerprint = pSample.Picture
End Sub
Private Sub fpRegister_Done(ByVal pTemplate As Object)
lblStatus.Caption = ""
Set Template = Nothing
Set Template = pTemplate
Call SaveDetails
End Sub
Private Sub fpRegister_SampleReady(ByVal pSample As Object)
pSample.PictureOrientation = Or_Portrait
pSample.PictureWidth = picFingerprint.Width / Screen.TwipsPerPixelX
pSample.PictureHeight = picFingerprint.Height / Screen.TwipsPerPixelY
picFingerprint.Picture = pSample.Picture
lblStatus.Caption = "Sample ready"
End Sub
Private Sub optRegister_Click()
If optRegister.Value = True Then
lblStatus.Caption = "Before Putting finger on the sensor - Enter user details "
txtUserCode = "": txtUserName = "": picFingerprint.Picture = Nothing
txtUserCode.Enabled = True: txtUserName.Enabled = True
Set fpGet = Nothing
Set fpRegister = Nothing
Set fpRegister = New FPRegisterTemplate
fpRegister.Run
lblStatus.Caption = "Register: Press your finger in the device"
Else
lblStatus.Caption = "Press your finger in the device... "
txtUserCode = "": txtUserName = "": picFingerprint.Picture = Nothing
txtUserCode.Enabled = False: txtUserName.Enabled = False
Set fpRegister = Nothing
Set fpGet = Nothing
Set fpGet = New FPGetTemplate
fpGet.Run
lblStatus.Caption = "Verify: Press your finger in the device"
End If
End Sub
in the act of kindness kindly give me a solution !!!!!!
my email add is gogoi.jayanta@gmail.com
a lots of thanks.
|
|
|
|
|
You might mention that you are using VB6 - then everyone can ignore your post. There are very few developers using VB6 - it's been a dead language for some years.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
jayanta gogoi wrote: my email add is gogoi.jayanta@gmail.com
That is stupid, it will just get you spam. You will get an email whenever anyone answers your post, anyhow.
Also, as someone else said, VB6 is a dead language, why would you use it ? It was always crap, but it's been unsupported for years.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
VB6 and a new application... Doesn't make sense. As Mycroft pointed out VB6 is dead. Move on to VB.Net
|
|
|
|
|
Sir
i am using Query for insert data in database as shown
Dim updatestr as string
updatestr = "Insert into company values ('Vineet', '9982823004', 'Bikaner')"
This Query working properly but i add a spacial charter in this Query as shown then it is not working.
Dim updatestr as string
updatestr = "Insert into company values ('Vineet's Company', '9982823004', 'Bikaner')"
so help me
Thanks
Vineet Swami
Isol
|
|
|
|
|
use the below query
updatestr = "Insert into company values ('Vineet'''s Company', '9982823004', 'Bikaner')"
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
use string.Replace("'", "''") to fix your strings,or just use stored procs, or parameterised queries, which do this for you.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If you're using SQL Server, use SqlParameter. You won't have problems with special characters and you won't leave open to sql injections. See: SqlParameter[^]
modified on Saturday, December 20, 2008 6:45 AM
|
|
|
|
|
Hi,
i have to validate my password with this rules
1.i can enter any alpha numeric charcter
2.I can enter anything in a valid speical character set
so i write my regular expression like this
[a-zA-Z0-9 + strspecialCharacterString +]
and to avoid special meaning of speical character i am adding \ in front of every special
character.Now my problem in wen i use an _ in my pattern ie some thing like "*_<" it is not
working.It throws an error below
"parsing "[\*\_\<]" - Unrecognized escape sequence \_."
if i give \\ instead of \ it is working.can any body help me in sorting out this problem?
Thanks in advance
shally
sdf
|
|
|
|
|
Hi,
The underscore character is not a special character inside a regex, so it should NOT be escaped by
a backslash; and when you prefix it by two backslashes, you are actually adding a single backslash
to the list of acceptable characters.
|
|
|
|
|
hi,
Thanks a lot for your my answer.But i have one doubt.Why error is throwing only if we use underscore character."!,@,:" etc are not special character.But if i use them in my pattern no error is throwing. Why is it like this?
Shally
sdf
|
|
|
|
|
These are the characters that have a special meaning in a regex expression:
$ ^ { [ ( | ) * + ? \
If you need one of them literally, then you must escape it with a backslash;
all other characters (including _ ! @ : ) are regular characters, just like a thru z and 0 thru 9.
|
|
|
|
|
Hi all...
I am using VS2005. I am trying to execute a URL as follows :
process.start("URL path here")
This start the website.. But I want to open this URL but in hide mode..
So that when it wil open URL it, will not visible to user.
Please suggest me how can I do this.
Thanks.
Gagan
|
|
|
|
|
I'm not sure there's a way to do that. Why would you want to run a URL invisibly ? your best bet to do that is to put an invisible web control on your form and open the page there.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
this may help u
Dim p1 As New System.Diagnostics.Process
p1.StartInfo.WindowStyle = ProcessWindowStyle.Normal
p1.StartInfo.FileName = "C:\Program Files\Internet Explorer\iexplore.exe"
p1.StartInfo.Arguments = "yahoo.com"
p1.StartInfo.UseShellExecute = True
p1.Start()
'p1.WaitForExit()
p1.Close()
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Why ? How does it hide the window ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|