Reading Data From File with Electron

in #utopian-io6 years ago

Repository

https://github.com/electron/electron

What Will I Learn?

  • You will learn to create an electron application
  • You will learn how to read files with electron

Requirements

Difficulty

  • Intermediate

Description

  • In this video I will show you how to read data from file operations with electron
    I will create the data reading codes from the file using the file system codes in nodejs
    I have created an example for you to better understand the subject

STEP 1

I have added one file containing the data the name of the file contacts
The data holds the information of the users
Our application will allow us to login the user using this data

STEP 2

I will design a page that request a username and password
I will print success if the Values entered are equal to the Values in the file
İf it is not equal I will write an error

Let’s start

Firstly I will show the codes I wrote

1.jpg

I wrote the user name and password field
and create a button and message label
I will do the codes create a page named a view.js
Define a Jquery and file system

2.jpg
Let’ s keep the name of the contacts file in filename
3.jpg
Catch the moment when button is clicked
4.jpg

Define username and password input

5.jpg

6.jpg

I will desşgn the button and input Bootstrap so I wrote the Bootstrap extension

So we can now capture the Values entered into the inputs
Now we read all the data in the file

7.jpg

Converted to utf8 format
I defined an array based on the space
Let’s write the console at thesame time
We can now return in this array

8.jpg

Then we split the data by comma we can Access all the information of a user
So we named each field
There are two areas as seen, the first domain represent the name and the second field represent value
Operator colon separeting these two fields

9.jpg

Let’s check whether the data in the file is written to the input equally

10.jpg

İf it is equal to flag value
Set i=1;

İf i value one is success else print error

11.jpg

Video Tutorial

Sort:  

Hi @sanalrakam,

Thank you for your contribution. It has been reviewed and scored accordingly.

There are a few things that you need to improve on:

  • the content of your tutorial
  • the presentation of your video tutorial
  • there is no structure in your presentation to keep the audience engaged to follow the tutorial.

When you do teaching presentation, you need to work out an overall procedure so that your learns grab the main points that you are teaching.

Perhaps you can listen to this video tutorial so that you get an idea of how to do video tutorials.

https://steemit.com/utopian-io/@buckydurddle/vcv-rack-frozen-wasteland-s-vox-inhumana#@rosatravels/re-buckydurddle-vcv-rack-frozen-wasteland-s-vox-inhumana-20180503t165108604z

Thank you.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

thank for advice , i am so sory i have a question may i take upvote to utopian bot?

It takes time for the bot to upvote as there is a queue of quality posts getting upvoted first.

Congratulations @sanalrakam! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.

To support your work, I also upvoted your post!
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Loading...

Coin Marketplace

STEEM 0.27
TRX 0.13
JST 0.032
BTC 64453.46
ETH 2971.59
USDT 1.00
SBD 3.59