Results 1 to 5 of 5

Thread: Deleting certain parts of a text file

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    14

    Question Deleting certain parts of a text file

    I am creating a childrens program where the user has an opportunity to change their password or delete an account. The information is inside a text file and i don't know how to delete only the password etc... At the moment my code is:
    vb Code:
    1. Public Function ChangePassword_Click(ByVal password As String, ByVal start As Integer, ByVal length As Integer, ByVal studentpass2 As String) As String
    2.     studentpass1 = InputBox("Please enter your previous password.")
    3.     studentpass2 = InputBox("Please enter your new password.")
    4.         If start + length >= Len(password) Then
    5.             DeleteSubString = Left(password, start - 1)
    6.         Else
    7.             DeleteSubString = Left(password, start) & Mid(password, start + length + 1)
    8.         End If
    9.         InsertSubString = Left(password, start - 1) & studentpass2 & Mid(password, start)
    10. MsgBox ("You have successfully changed your password"), vbExclamation
    11. End Function
    12. I have also tried this:
    13. Private Sub cmdchangepassword( ) Click
    14. Function (byVal username as String, ByVal password as String, ByVal studentpass1 as String, ByVal studentpass2 as String) as String
    15.     Replace (password, studentpass1, studentpass2
    16. End Function
    Nothing is working!!!
    Last edited by Hack; Oct 22nd, 2007 at 06:37 AM. Reason: Added Highlight Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width