Skip to content

MyLastAngel/backupapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Создает SQLLite DB

var sql = "CREATE TABLE IF NOT EXISTS DATA (" +
    "Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, " +
    "Url TEXT," +
    "Description TEXT," +
    "Icon TEXT); ";

sql = "CREATE TABLE IF NOT EXISTS DATA_RECORD (" +
    "Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, " +
    "DataId INTEGER, " +
    "Name TEXT, " +
    "Value TEXT, " +
    "Description TEXT, " +
    "FOREIGN KEY(DataId) REFERENCES DATA(Id)" +
    ");";

БД хранится в папке директории

string.Format(@"{0}\DB", Environment.CurrentDirectory);

Защита заключается в том что пароль для шифра БД известен только создавшему БД

static string GetConnectionString(string pswd, bool isReadOnly)
{
    var path = string.Format("{0}\\cache.db", CommonManager.GetDirectory(DirectoryMode.DB));

    if (!File.Exists(path))
        isReadOnly = false;

    var result = string.Format("Data Source='{0}'; Version=3; Password={1}; {2}", path, pswd, isReadOnly ? "ReadOnly=True;" : "");
    return result;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages