Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Simple Login

Simple Login

Scheduled Pinned Locked Moved C#
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andredani
    wrote on last edited by
    #1

    How do i login by a streamreader .txt file..? when: textbox1.text(username) textbox2.text(username) .txt file are build like this # username password Tnx All!!;):laugh::)

    C 1 Reply Last reply
    0
    • A andredani

      How do i login by a streamreader .txt file..? when: textbox1.text(username) textbox2.text(username) .txt file are build like this # username password Tnx All!!;):laugh::)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      your question is missing a lot of details. File.ReadAllLines ( from memory ) returns a string array from your file, so that's a good way to get out your username and password, is that the bit you're stuck on ? Log on to where ? What do textboxes have to do with it ? Is there a typo in your post, is the second textbox the password ? They are surely not named that ?

      Christian Graus - Microsoft MVP - C++ "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 )

      A 1 Reply Last reply
      0
      • C Christian Graus

        your question is missing a lot of details. File.ReadAllLines ( from memory ) returns a string array from your file, so that's a good way to get out your username and password, is that the bit you're stuck on ? Log on to where ? What do textboxes have to do with it ? Is there a typo in your post, is the second textbox the password ? They are surely not named that ?

        Christian Graus - Microsoft MVP - C++ "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 )

        A Offline
        A Offline
        andredani
        wrote on last edited by
        #3

        no that´s just an example.. On a button_click event string q = textBox1.Text; string w = textBox2.Text; string[] lines = System.IO.File.ReadAllLines(".txt"); Int32 index = 0; while (lines.Length >= index + 10) { if ("#" != lines[index].Trim()) { index++; continue; } String username = lines[index + 0]; String password = lines[index + 1]; index += 1; if (q = username && w = password) something like this.. but its wrong, how do i start a search on textbox1.text on row0 and textbox2.text are gonna be below.. or something??? tnx:laugh:;);P:^):( -- modified at 12:47 Friday 7th September, 2007

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups