Announcement

Collapse
No announcement yet.

How to seach specific string on the file and change it?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to seach specific string on the file and change it?

    Hello i am really doing it to myself for almost 3 days but since i am a programmer its really hard for me to locate the answer of my thoughts..

    Here is the problem, i have a .html file containing a login, but i want to change the password using my AMS app..
    on my html file on line 97 i have this code:

    if(user == "user" && pass == "password"){
    window.location.href="page1.html"

    }else{
    alert("Incorrect username or password");
    }
    }
    what i was trying to manipulate is i can change the "user" and "password" anything i want and save it as "login.html"

    is anyone could help me?

    Thanks in advance..

  • #2
    Hello i am really doing it to myself for almost 3 days but since i am NOT a programmer its really hard for me to locate the answer of my thoughts..

    Comment


    • #3
      update... anyone please? thanks...

      Comment


      • #4
        Use TextFile.ReadToString() to read the HTML into a string. Then use String.Replace() to change the HTML loaded in memory. Finally, save the changed file with TextFile.WriteFromString().

        Ulrich

        Comment

        Working...
        X