|
-
Sep 28th, 2000, 06:05 AM
#1
Thread Starter
New Member
I am writing a password program for my PC but when I open the text file and put the text (password) in to a string then save a different password it puts quote marks round the new password which means it wont work next time. how can I delete these quote marks or get
it so it doesn't read them in.
EG "password"
Thanks Jon
-
Sep 28th, 2000, 06:09 AM
#2
Use the Replace function.
Code:
Dim strPW As String
strPW = "EG" & Chr(34) & "password" & Chr(34)
strPW = Replace(strPW, Chr(34), "")
-
Sep 28th, 2000, 06:10 AM
#3
Could you post your password loading and saving code?
Sunny
-
Sep 28th, 2000, 06:11 AM
#4
Fanatic Member
No idea what you are talking about, but to read between the quotes, you can use Mid:
Code:
Dim strPW as String
strPW = Mid(Password, 2, Len(Password) - 1)
r0ach™
Don't forget to rate the post
-
Sep 28th, 2000, 07:15 AM
#5
_______
<?>
if you are writing to a text file with the Write Command
it will enclose the string in quotes...if you use the
Print Command to write it will not.
Open bla for bla as bla
Print #bla, mystring
close bla
No Quotes..
another way..if you use vb6 is the replace function.
Code:
Private Sub Command1_Click()
Dim mySting As String
mystring = """Help me out"""
MsgBox mystring
mystring = Replace(mystring, """", "")
MsgBox mystring
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 28th, 2000, 12:52 PM
#6
Thread Starter
New Member
Thanks everyone!
I swapped the write Statement for print and it worked perfectly.
sunnyl:
I'm not exactly sure what you mean but to open the text file and read the text into a string
I used:
Open "C:\pass.dat" For Input As #1
Input #1, password
Close #1
and to write the file back to the file:
Open "C ass.dat" For Output As #2
Print #2, password
Close #2
Hope this helped
Jon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|