加密,解密Sqlite数据库
加密,解密Sqlite数据库加密,解密Sqlite数据库 加密一个未加密的数据库或者更改一个加密数据库的密码,打开数据库,启动SQLiteConnection的ChangePassword()函数 // Opens an unencrypted database SQLiteConnection cnn = newSQLiteConnection("Data Source=c:test.db3"); cnn.Open(); // Encrypts the database. The connection remains valid and usable afterwards. cnn.ChangePassword("mypassword"); 解密一个已加密的数据库调用l ChangePassword()将参数设为 NULL or "" : // Opens an encrypted database SQLiteConnection cnn = newSQLiteConnection("Data Source=c:test.db3;Password=mypassword"); cnn.Open(); // Removes the encryption on an encrypted database. cnn.ChangePassword(""); 要打开一个已加密的数据库或者新建一个加密数据库,在打开或者新建前调用SetPassword()函数 // Opens an encrypted database by calling SetPassword() SQLiteConnection cnn = newSQLiteConnection("Data Source=c:test.db3"); cnn.SetPassword(newbyte[] { 0xFF,0xEE,0xDD,0x10,0x20,0x30 }); // The connection is now usable (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |