@BrandonGreen5/

DHLDataEntryLogin

C++

This is only the user and password information.

fork
loading
Files
  • main.cpp
  • zones and units

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.7199677146200922","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnN0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKYm9vbCBJc0xvZ2dlZEluKCkKCnsKICAgIHN0cmluZyB1c2VybmFtZSwgcGFzc3dvcmQsIHVuLCBwdzsgCgogICAgY291dCA8PCAiIEVudGVyIFVzZXJuYW1lOiAgIjsKICAgIGNpbiA+PiB1bjsKICAgIGNvdXQgPDwgIkVudGVyIFBhc3N3b3JkOiAgIjsKICAgIGNpbiA+PiBwdzsgCgogICAgaWZzdHJlYW0gcmVhZCAoImRhdGEvLyIgKyB1biArIi50eHQiKTsKICAgIGdldGxpbmUocmVhZCwgdXNlcm5hbWUpOwogICAgZ2V0bGluZShyZWFkLHBhc3N3b3JkKTsKICAgIGlmICggdW4gPT0gdXNlcm5hbWUgJiYgcHcgPT0gcGFzc3dvcmQpCnsKICByZXR1cm4gdHJ1ZTsKCn0KZWxzZQp7CiAgcmV0dXJuIGZhbHNlOwoKfQoKfQoKaW50IG1haW4gKCkKewogIGludCBjaG9pY2U7CiAgY291dCA8PCAiMTpSZWdpc3RlclxuMjpMb2dpblxuWW91ciBjaG9pY2U6ICAiOwogIGNpbj4+IGNob2ljZTsKICBpZiAoIGNob2ljZSA9PSAxKQogIHsKICAgICAgc3RyaW5nIHVzZXJuYW1lLCBwYXNzd29yZDsKCiAgICAgIGNvdXQgPDwiU2VsZWN0IGEgdXNlcm5hbWU6ICAiOwogICAgICBjaW4gID4+IHVzZXJuYW1lOwogICAgICBjb3V0IDw8ICJTZWxlY3QgYSBwYXNzd29yZDogICI7CiAgICAgIGNpbiAgPj4gcGFzc3dvcmQ7CgoKCiAgICAgIAoKCiAgICAgIG9mc3RyZWFtIGZpbGU7CgogICAgICBmaWxlLm9wZW4oImRhdGEvLyIgKyB1c2VybmFtZSArIi50eHQiKTsKICAgICAgZmlsZSA8PCB1c2VybmFtZSA8PCBlbmRsIDw8IHBhc3N3b3JkOwogICAgICBmaWxlLmNsb3NlKCk7CiAgICAgIG1haW4oKTsKCmZpbGUub3BlbiAodXNlcm5hbWUgKyAiLnR4dCIpOwppZnN0cmVhbSByZWFkICh1biArICIudHh0Iik7CgoKCgoKICB9CiAgZWxzZSBpZiAoIGNob2ljZSA9PSAyKQogIHsgCiAgICAgIGJvb2wgc3RhdHVzID0gSXNMb2dnZWRJbigpOwogICAgICBpZiAoIXN0YXR1cykKICAgICAgewoKICAgICAgICBjb3V0IDw8ICIgRmFpbGVkIExvZ2luISIgPDwgZW5kbDsKICAgICAgICBzeXN0ZW0oIlBhdXNlIik7CiAgICAgIH0KICAgICAgZWxzZSAKICAgICAgewoKICAgICAgICBjb3V0IDw8ICIgU3VjY2Vzc2Z1bGx5IExvZ2dlZCBJbiEiIDw8IGVuZGw7CiAgICAgICAgc3lzdGVtKCJQQVVTRSIpOwogICAgICAgIHJldHVybiAxOwogICAgICB9CgoKICAgICAgCiAgICAgIH0KICAgICAgcmV0dXJuIDAgOwogIAp9CgpXaGlsZSggdHJ1ZSkKCnsKICBjb3V0IDw8ICIgRW50ZXIgem9uZTogIjsKICAvL0dldCB6b25lIGFuZCBpbmZvIGFib3V0IGhvdXJzIGFuZCB1bml0cyBmb3IgdGhpcyB6b25lCiAgY291dDw8ICIgRW50ZXIgYW5vdGhlciB6b25lPyAoeS9uKSIKICBzdHJpbmcgcmVzcG9uc2U7CiAgY2luPj5yZXNwb25zZTsKICBpZihyZXNwb25zZT09Im4iKQp7CiAgYnJlYWs7Cgp9CgoKCgp9Cgo="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include <iostream>
#include <fstream>
#include <string>

using namespace std;


bool IsLoggedIn()

{
    string username, password, un, pw; 

    cout << " Enter Username:  ";
    cin >> un;
    cout << "Enter Password:  ";
    cin >> pw; 

    ifstream read ("data//" + un +".txt");
    getline(read, username);
    getline(read,password);
    if ( un == username && pw == password)
{
  return true;

}
else
{
  return false;

}

}

int main ()
{
  int choice;
  cout << "1:Register\n2:Login\nYour choice:  ";
  cin>> choice;
  if ( choice == 1)
  {
      string username, password;

      cout <<"Select a username:  ";
      cin  >> username;
      cout << "Select a password:  ";
      cin  >> password;



      


      ofstream file;

      file.open("data//" + username +".txt");
      file << username << endl << password;
      file.close();
      main();

file.open (username + ".txt");
ifstream read (un + ".txt");





  }
  else if ( choice == 2)
  { 
      bool status = IsLoggedIn();
      if (!status)
      {

        cout << " Failed Login!" << endl;
        system("Pause");
      }
      else 
      {

        cout << " Successfully Logged In!" << endl;
        system("PAUSE");
        return 1;
      }


      
      }
      return 0 ;
  
}

While( true)

{
  cout << " Enter zone: ";
  //Get zone and info about hours and units for this zone
  cout<< " Enter another zone? (y/n)"
  string response;
  cin>>response;
  if(response=="n")
{
  break;

}




}