07-31-2012 01:10 AM
How to create a login ID and password just like in the case of any website?
Suppose a new user is there, at first he should create his own login ID and password that will be stored in some file.Then whenever the next time he tries to open up the VI and enters his login ID and password it should be searched and matched up with the one stored in the file and then user should be given the access.
And there might be many users.
Solved! Go to Solution.
07-31-2012
02:00 AM
- last edited on
05-28-2025
12:27 PM
by
Content Cleaner
07-31-2012 02:09 AM
In that a constant is provided for the password.
But how to read and match User ID and Password from a particular file?
07-31-2012 03:13 AM
07-31-2012
04:00 AM
- last edited on
05-28-2025
12:28 PM
by
Content Cleaner
As GerdW mentioned you need to read & write using the functions in File IO palette
I have attached a sample vi to read/write data .There are many ways to to do it.
Following links are useful.
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/menus/categories/programming/file-mnu.html
http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/choosing_a_file_i_o_format/
07-31-2012 05:44 AM
Thanks for the reply.
I was looking at the example shipped with LabVIEW, Login Dialog.vi.There they have used the table control.
I am able to write the data in an excel sheet, that means I am able to create New User ID and Password.But not able to read from the file and compare it.
Is it ok to write it to an excel file? or just use the write to text function and then read from it? and how to compare it with the ID and Password entered by the user for further authentication?
07-31-2012 05:49 AM
"Well, I would read the file, search for the given UserID to get the predefined password and compare that with the user given one".
I'm afraid but thats the part I am not getting how to do.
Create User ID and password, & Read the file - Ok.
But how to search the User ID to get its created password and compare it with the one entered by the user?
07-31-2012 05:53 AM
Hi Sunny,
"Create User ID and password, & Read the file - Ok."
- How can I suggest anything when you don't tell how your file is organized/formatted?
- Even saying "I'm using an Excel file" isn't sufficient as it's a huge difference to use real Excel files (xls, xlsx) or plain text files (cst, txt) which can be read by Excel too.
I can only suggest to use a csv file, read it with ReadSpreadsheetFile, use Search1DArray to search the UserID column for your user and index the password column for the password check. That's pretty basic, requiring only 5 or 6 ready-to-use LabVIEW functions. If you aren't able to set it up on your own I would recommend to go through the LabVIEW basic courses offered by NI...
07-31-2012 07:03 AM
07-31-2012 07:25 AM
Hi GerdW,
Thanks a lot its done.