Post: Login form
06-12-2016, 07:34 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); i want to save a .bin file to the Documents folder and what i have is this directory: C:\Users\Felix\Documents\Accounts\file.bin but every computer have a different directory/name and i want to know how to make this work on any computer
(adsbygoogle = window.adsbygoogle || []).push({});
06-13-2016, 12:41 PM #2
Hash847
Purple God
Originally posted by VadRe View Post
i want to save a .bin file to the Documents folder and what i have is this directory: C:\Users\Felix\Documents\Accounts\file.bin but every computer have a different directory/name and i want to know how to make this work on any computer


out of memory in C# it is

    
System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);


to be specific you can do (which I advise against without any kind of hashing)

    
string account_data = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + "/account/";

bool compare_credentials(string username, string password) {
if (!System.IO.File.Exists(account_data + "file.bin"))
return false;

string credential_string[] = System.IO.File.ReadAllLines(account_data + "file.bin");
if (credential_string[0] == username && credential_string[1] == password)
return true;
return false;
}

void write_credentials(string username, string password) {
string credentials[] = { username, password };
System.IO.File.WriteAllLines(account_data + "file.bin", credentials);
}


it's very crude and unsafe and I highly suggest against doing this but it should work.
06-13-2016, 12:41 PM #3
Default Avatar
Oneup
Guest
Originally posted by VadRe View Post
i want to save a .bin file to the Documents folder and what i have is this directory: C:\Users\Felix\Documents\Accounts\file.bin but every computer have a different directory/name and i want to know how to make this work on any computer

This has nothing to do with a login system.

In any case you would use this:
You must login or register to view this content.
06-13-2016, 12:42 PM #4
Sloth
Banned
Originally posted by VadRe View Post
i want to save a .bin file to the Documents folder and what i have is this directory: C:\Users\Felix\Documents\Accounts\file.bin but every computer have a different directory/name and i want to know how to make this work on any computer


Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo