中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

金融類的網(wǎng)站怎么做杭州網(wǎng)絡(luò)推廣有限公司

金融類的網(wǎng)站怎么做,杭州網(wǎng)絡(luò)推廣有限公司,政府基層網(wǎng)站建設(shè)問(wèn)題ppt,網(wǎng)站建設(shè)名片一:讓 SQLiteExpert 支持(cipher)加密數(shù)據(jù)庫(kù) SQLiteExpert 作為SQlite 的管理工具,默認(rèn)不支持加密數(shù)據(jù)庫(kù)的,使其成為支持(cipher)加密數(shù)據(jù)庫(kù)的管理工具,需要添加e_sqlcipher.dll &…

? ? ? 一:讓 SQLiteExpert? 支持(cipher)加密數(shù)據(jù)庫(kù)

?????????SQLiteExpert? 作為SQlite?的管理工具,默認(rèn)不支持加密數(shù)據(jù)庫(kù)的,使其成為支持(cipher)加密數(shù)據(jù)庫(kù)的管理工具,需要添加e_sqlcipher.dll (復(fù)制到SQLiteExpertPro32/64.exe?同級(jí)目錄即可,從哪里來(lái)的這個(gè)問(wèn)題:你可以直接往后面下載鏈接下,也可以跟隨文章知道從哪里來(lái)的。最好是知道從哪里來(lái)的,也許我放鏈接的版本在未來(lái)有新版本更替,我也就不更新下載鏈接了。),并在其設(shè)置里面進(jìn)行勾選就能激活加密數(shù)據(jù)庫(kù)支持。如下圖所示(幾個(gè)關(guān)鍵點(diǎn)已經(jīng)標(biāo)記),需要注意的是SQLiteExpert? 32位/64位需要與e_sqlcipher.dll 32位/64位匹配,否則在32位版的SQLiteExpert? 是看不到64位的e_sqlcipher.dll。

加入成功后,打開(kāi)或者新建數(shù)據(jù)庫(kù)都有加密選項(xiàng)

(新建數(shù)據(jù)庫(kù))

(打開(kāi)加密數(shù)據(jù)庫(kù))

這樣到此可以完整的處理了SQLiteExpert?支持加密

????????由于SQLiteExpert?只有windows?版本,linux?平臺(tái)的cipher加密支持庫(kù)也就不打包了。對(duì)于跨平臺(tái)的SQLite?gui?也許類似,上傳的壓縮包就只有windows平臺(tái)dll。

下載鏈接在頂部,壓縮包結(jié)構(gòu)如下:

二. .Net C#?連接(cipher)加密的SQlite數(shù)據(jù)庫(kù)

nuget

1、SQLitePCLRaw.bundle_e_sqlcipher

2、Microsoft.Data.Sqlite

3、Costura.Fody (如果不需要考慮發(fā)布潔癖(單文件,全部外圍DLL聚合),就沒(méi)必要。)

直接debug,生成一堆內(nèi)容,我隨便建立了個(gè)VS 工程(sqlitedemo)?debug目錄大致如下:

runtime?內(nèi)容如下:(也就是各種平臺(tái)的(cipher)sqlite?lib),前面的e_sqlcipher.dll取材就是從這里取得。

debug?生成的很多,也就是剛才說(shuō)的發(fā)布生成潔癖的問(wèn)題,如果你在意,發(fā)布時(shí)候選擇輸出好平臺(tái),runtime可以自動(dòng)減少,但是依舊會(huì)生成其他dll。

那就采用Costura.Fody

編輯項(xiàng)目?jī)?nèi) FodyWeavers.xml?文件(nuget過(guò)了會(huì)自動(dòng)生成該文件),文件內(nèi)容修改如下:

<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"><Costura ><Unmanaged64Assemblies>e_sqlciphere_sqlite3</Unmanaged64Assemblies><Unmanaged32Assemblies>e_sqlciphere_sqlite3</Unmanaged32Assemblies></Costura>
</Weavers>

再編輯?解決方案文件(右邊第一箭頭那里雙擊)

主要語(yǔ)句加入 (我選擇的x64版本的Exe)

?<RuntimeIdentifier>win-x64</RuntimeIdentifier>

????????這樣,右鍵點(diǎn)擊?解決方案->重新生成解決方案 (這里要注意,要重新整個(gè)解決方案才行。更改解決方案文件,直接debug會(huì)有問(wèn)題。)

? ? ? ? 最終生成輸出內(nèi)容如下:

其他亂七八糟的dll沒(méi)有了,清爽吧?!?

再來(lái)看相關(guān)C#?連接Sqlite?操作的代碼:先上SqliteHelper,順便也推薦一下 Cody?AI生成的,我用了很長(zhǎng)時(shí)間,免費(fèi)且好用(面向編程)。

    public class SQLiteHelper{private readonly string _connectionString;public SQLiteHelper(string dbPath, string password = null){var builder = new SqliteConnectionStringBuilder{DataSource = dbPath,Mode = SqliteOpenMode.ReadWriteCreate};if (!string.IsNullOrEmpty(password)){builder.Password = password;}_connectionString = builder.ConnectionString;}public int ExecuteNonQuery(string sql, List<SqliteParameter> parameters = null){using (var connection = new SqliteConnection(_connectionString)){connection.Open();using (var command = connection.CreateCommand()){command.CommandText = sql;if (parameters != null){command.Parameters.AddRange(parameters);}return command.ExecuteNonQuery();}}}public T ExecuteScalar<T>(string sql, List<SqliteParameter> parameters = null){using (var connection = new SqliteConnection(_connectionString)){connection.Open();using (var command = connection.CreateCommand()){command.CommandText = sql;if (parameters != null){command.Parameters.AddRange(parameters);}var result = command.ExecuteScalar();return (T)Convert.ChangeType(result, typeof(T));}}}public List<T> ExecuteQuery<T>(string sql, List<SqliteParameter> parameters = null) where T : new(){var result = new List<T>();using (var connection = new SqliteConnection(_connectionString)){connection.Open();using (var command = connection.CreateCommand()){command.CommandText = sql;if (parameters != null){command.Parameters.AddRange(parameters);}using (var reader = command.ExecuteReader()){while (reader.Read()){var item = new T();for (int i = 0; i < reader.FieldCount; i++){var property = typeof(T).GetProperty(reader.GetName(i), BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance);if (property != null && !reader.IsDBNull(i)){property.SetValue(item, Convert.ChangeType(reader.GetValue(i), property.PropertyType));}}result.Add(item);}}}}return result;}public void ExecuteTransaction(Action<SqliteConnection> action){using (var connection = new SqliteConnection(_connectionString)){connection.Open();using (var transaction = connection.BeginTransaction()){try{action(connection);transaction.Commit();}catch{transaction.Rollback();throw;}}}}}
}

調(diào)用如下:

SQLiteHelper?構(gòu)造函數(shù),第一個(gè)參數(shù)數(shù)據(jù)庫(kù)路徑文件全名,第二個(gè)參數(shù)數(shù)據(jù)庫(kù)密碼

   SQLiteHelper SLH = new SQLiteHelper("D:\\Manage\\Documents\\db", "TEST");const int batchSize = 100000;const string insertSql = "INSERT INTO Student (F_ID, F_Name) VALUES (@F_ID, @F_Name)";SLH.ExecuteTransaction(connection =>{using var command = connection.CreateCommand();command.CommandText = insertSql;command.Parameters.Add("@F_ID", SqliteType.Text);command.Parameters.Add("@F_Name", SqliteType.Text);for (int i = 0; i < batchSize; i++){command.Parameters["@F_ID"].Value = Guid.NewGuid().ToString();command.Parameters["@F_Name"].Value = $"John{i}";command.ExecuteNonQuery();}});

密碼錯(cuò)誤則在這里報(bào)錯(cuò):

這樣既可以C#?開(kāi)發(fā)加密數(shù)據(jù)庫(kù)又可以在外部用外部工具直接編輯加密數(shù)據(jù)庫(kù)的環(huán)境就達(dá)成了。

后話:

? ? ? ? 選擇SQLiteExpert?是界面要黑一點(diǎn),可能不是最好用的,但黑色看起來(lái)眼睛舒服一點(diǎn),歡迎推薦一些。

http://www.risenshineclean.com/news/55633.html

相關(guān)文章:

  • 網(wǎng)站開(kāi)發(fā)詳細(xì)介紹搜索引擎營(yíng)銷的基本方法
  • 做導(dǎo)航網(wǎng)站電腦設(shè)備seo可以從哪些方面優(yōu)化
  • 自己做網(wǎng)站iis設(shè)置女教師遭網(wǎng)課入侵直播錄屏曝光視頻
  • 制作一個(gè)網(wǎng)站怎么做北京優(yōu)化推廣
  • 做最好的網(wǎng)站新新seo刷排名軟件
  • yy8848青蘋(píng)果影私人視院濰坊百度快速排名優(yōu)化
  • 建站之星模板的使用seo發(fā)展前景怎么樣啊
  • 網(wǎng)站源碼 和網(wǎng)站模板區(qū)別培訓(xùn)平臺(tái)
  • 北京建網(wǎng)站找哪個(gè)公司網(wǎng)站廣告調(diào)詞軟件
  • 上海醫(yī)療器械網(wǎng)站前置審批百度平臺(tái)商家聯(lián)系方式
  • c2c代表網(wǎng)站有哪些百度代理查詢
  • wordpress文章靜態(tài)網(wǎng)絡(luò)seo是什么
  • 網(wǎng)站怎么做才能用手機(jī)打開(kāi)網(wǎng)頁(yè)在線代理翻墻
  • 起點(diǎn)網(wǎng)站書(shū)的封面怎們做百度搜索高級(jí)搜索技巧
  • 可視化建站網(wǎng)站源碼百度高級(jí)搜索首頁(yè)
  • 網(wǎng)站色情營(yíng)銷特點(diǎn)鄭州seo管理
  • 在百度做網(wǎng)站需要什么資料2023重大新聞事件10條
  • app網(wǎng)站維護(hù)廣州網(wǎng)站建設(shè)推薦
  • 網(wǎng)站優(yōu)化有前途嗎b站好看的紀(jì)錄片免費(fèi)
  • 咸陽(yáng)b2c網(wǎng)站制作價(jià)格ai智能營(yíng)銷系統(tǒng)
  • 男女做暖暖到網(wǎng)站手機(jī)上怎么制作網(wǎng)頁(yè)
  • 網(wǎng)站舉報(bào)網(wǎng)怎樣申請(qǐng)自己的電商平臺(tái)
  • 建設(shè)一個(gè)政府部門(mén)網(wǎng)站商丘網(wǎng)站推廣公司
  • 字節(jié)跳動(dòng)小程序開(kāi)發(fā)平臺(tái)seo網(wǎng)站編輯是做什么的
  • wordpress加密文章班級(jí)優(yōu)化大師免費(fèi)下載app
  • 做網(wǎng)站公司百度關(guān)鍵詞點(diǎn)擊器
  • 溫州網(wǎng)站建設(shè)優(yōu)化自己的品牌怎么做加盟推廣
  • 模板網(wǎng)站 怎么做優(yōu)化谷歌官方網(wǎng)站注冊(cè)
  • 三門(mén)峽網(wǎng)站seo優(yōu)化網(wǎng)站排名的方法
  • 網(wǎng)站制作鄭州網(wǎng)站制作yoast seo