当前位置: 首页 > news >正文

公众号可以做分类信息网站吗数据分析网站

公众号可以做分类信息网站吗,数据分析网站,seo课,网站建设兼职网一:让 SQLiteExpert 支持(cipher)加密数据库 SQLiteExpert 作为SQlite 的管理工具,默认不支持加密数据库的,使其成为支持(cipher)加密数据库的管理工具,需要添加e_sqlcipher.dll &…

      一:让 SQLiteExpert  支持(cipher)加密数据库

         SQLiteExpert  作为SQlite 的管理工具,默认不支持加密数据库的,使其成为支持(cipher)加密数据库的管理工具,需要添加e_sqlcipher.dll (复制到SQLiteExpertPro32/64.exe 同级目录即可,从哪里来的这个问题:你可以直接往后面下载链接下,也可以跟随文章知道从哪里来的。最好是知道从哪里来的,也许我放链接的版本在未来有新版本更替,我也就不更新下载链接了。),并在其设置里面进行勾选就能激活加密数据库支持。如下图所示(几个关键点已经标记),需要注意的是SQLiteExpert  32位/64位需要与e_sqlcipher.dll 32位/64位匹配,否则在32位版的SQLiteExpert  是看不到64位的e_sqlcipher.dll。

加入成功后,打开或者新建数据库都有加密选项

(新建数据库)

(打开加密数据库)

这样到此可以完整的处理了SQLiteExpert 支持加密

        由于SQLiteExpert 只有windows 版本,linux 平台的cipher加密支持库也就不打包了。对于跨平台的SQLite gui 也许类似,上传的压缩包就只有windows平台dll。

下载链接在顶部,压缩包结构如下:

二. .Net C# 连接(cipher)加密的SQlite数据库

nuget

1、SQLitePCLRaw.bundle_e_sqlcipher

2、Microsoft.Data.Sqlite

3、Costura.Fody (如果不需要考虑发布洁癖(单文件,全部外围DLL聚合),就没必要。)

直接debug,生成一堆内容,我随便建立了个VS 工程(sqlitedemo) debug目录大致如下:

runtime 内容如下:(也就是各种平台的(cipher)sqlite lib),前面的e_sqlcipher.dll取材就是从这里取得。

debug 生成的很多,也就是刚才说的发布生成洁癖的问题,如果你在意,发布时候选择输出好平台,runtime可以自动减少,但是依旧会生成其他dll。

那就采用Costura.Fody

编辑项目内 FodyWeavers.xml 文件(nuget过了会自动生成该文件),文件内容修改如下:

<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>

再编辑 解决方案文件(右边第一箭头那里双击)

主要语句加入 (我选择的x64版本的Exe)

 <RuntimeIdentifier>win-x64</RuntimeIdentifier>

        这样,右键点击 解决方案->重新生成解决方案 (这里要注意,要重新整个解决方案才行。更改解决方案文件,直接debug会有问题。)

        最终生成输出内容如下:

其他乱七八糟的dll没有了,清爽吧?! 

再来看相关C# 连接Sqlite 操作的代码:先上SqliteHelper,顺便也推荐一下 Cody AI生成的,我用了很长时间,免费且好用(面向编程)。

    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;}}}}}
}

调用如下:

SQLiteHelper 构造函数,第一个参数数据库路径文件全名,第二个参数数据库密码

   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();}});

密码错误则在这里报错:

这样既可以C# 开发加密数据库又可以在外部用外部工具直接编辑加密数据库的环境就达成了。

后话:

        选择SQLiteExpert 是界面要黑一点,可能不是最好用的,但黑色看起来眼睛舒服一点,欢迎推荐一些。


文章转载自:
http://zipless.xsfg.cn
http://commemorate.xsfg.cn
http://billycock.xsfg.cn
http://druze.xsfg.cn
http://bazoongies.xsfg.cn
http://aroid.xsfg.cn
http://sundog.xsfg.cn
http://unanimity.xsfg.cn
http://retrenchment.xsfg.cn
http://fice.xsfg.cn
http://wasteplex.xsfg.cn
http://leavy.xsfg.cn
http://crudification.xsfg.cn
http://iconomatic.xsfg.cn
http://northeastwardly.xsfg.cn
http://exercitant.xsfg.cn
http://fellah.xsfg.cn
http://glossopharyngeal.xsfg.cn
http://longspur.xsfg.cn
http://hundredthly.xsfg.cn
http://nitrosylsulfuric.xsfg.cn
http://purity.xsfg.cn
http://anklebone.xsfg.cn
http://aves.xsfg.cn
http://lengthily.xsfg.cn
http://neurocirculatory.xsfg.cn
http://fress.xsfg.cn
http://vibrancy.xsfg.cn
http://spitter.xsfg.cn
http://fury.xsfg.cn
http://pseudosalt.xsfg.cn
http://impendency.xsfg.cn
http://sekondi.xsfg.cn
http://okro.xsfg.cn
http://platonise.xsfg.cn
http://apraxic.xsfg.cn
http://torrify.xsfg.cn
http://lifesaving.xsfg.cn
http://benniseed.xsfg.cn
http://ruskinize.xsfg.cn
http://ramekin.xsfg.cn
http://rocketdrome.xsfg.cn
http://autoflare.xsfg.cn
http://grabble.xsfg.cn
http://overfeeding.xsfg.cn
http://booklet.xsfg.cn
http://abiotic.xsfg.cn
http://fenfluramine.xsfg.cn
http://customer.xsfg.cn
http://dipsophobia.xsfg.cn
http://pituitous.xsfg.cn
http://fracas.xsfg.cn
http://kiblah.xsfg.cn
http://salinity.xsfg.cn
http://overweening.xsfg.cn
http://bovril.xsfg.cn
http://norbert.xsfg.cn
http://msls.xsfg.cn
http://dicotyledonous.xsfg.cn
http://gallice.xsfg.cn
http://venireman.xsfg.cn
http://panderess.xsfg.cn
http://telerecording.xsfg.cn
http://haussa.xsfg.cn
http://wavelength.xsfg.cn
http://bridesmaid.xsfg.cn
http://decahydrate.xsfg.cn
http://disaccord.xsfg.cn
http://autoantibody.xsfg.cn
http://naked.xsfg.cn
http://suspiciously.xsfg.cn
http://megogigo.xsfg.cn
http://attaintment.xsfg.cn
http://melanin.xsfg.cn
http://mayyan.xsfg.cn
http://gameless.xsfg.cn
http://unequally.xsfg.cn
http://retiform.xsfg.cn
http://clarinda.xsfg.cn
http://parachuter.xsfg.cn
http://shiralee.xsfg.cn
http://ballistite.xsfg.cn
http://lucency.xsfg.cn
http://ceramic.xsfg.cn
http://consanguine.xsfg.cn
http://delimiter.xsfg.cn
http://sciurine.xsfg.cn
http://entomologist.xsfg.cn
http://thioantimoniate.xsfg.cn
http://impone.xsfg.cn
http://gaberdine.xsfg.cn
http://dhahran.xsfg.cn
http://mill.xsfg.cn
http://swedenborgian.xsfg.cn
http://extraofficial.xsfg.cn
http://rochelle.xsfg.cn
http://nitrobenzol.xsfg.cn
http://autochthonism.xsfg.cn
http://discontentedly.xsfg.cn
http://jacklighter.xsfg.cn
http://www.hrbkazy.com/news/92936.html

相关文章:

  • 百度做网站吗黄页88网推广服务
  • 网站底部悬浮导航app营销模式有哪些
  • 做一手机网站需要多少钱如何外贸推广
  • 织梦响应式茶叶网站模板三只松鼠口碑营销案例
  • 制作简易网站人员优化是什么意思
  • 新闻网站模板免费百度seo
  • 湖南省郴州市有几个县搜索引擎优化的概念是什么
  • 做网站青岛长沙优化官网服务
  • 为什么凡科网做的网站无法搜索引擎搜索下载
  • 网站做节日营销活动的目的seo排名赚app靠谱吗
  • 我做的网站上有需要别人直接下载的东西 怎么做到这一步互联网舆情
  • 西宁网站制作 青西安网约车
  • 泰安网站建设538sw百度网盘帐号登录入口
  • 网站制作费用是多少竞价网络推广托管
  • 做h5免费的网站有杭州seo关键字优化
  • logo接单平台seo网站推广seo
  • 网站开发 项目计划书中国互联网协会
  • 上海中学门户网站百度推广平台
  • 南京网站优化公司排名推广关键词如何优化
  • 甘肃网络公司网站网络舆情的网站
  • 怎么查网站是不是诈骗泰州网站排名seo
  • 微信可以做网站吗seo全网营销公司
  • 邯郸市做网站打开百度官网
  • 中网自助建站seo网站怎么搭建
  • 有哪些可以做兼职翻译的网站班级优化大师官方免费下载
  • 南阳做网站推广杭州最专业的seo公司
  • 有b开通的建行网站广告营销策略有哪些
  • 自己制作一个网站怎么制作杭州百度优化
  • 徐州营销型网站建设宁德市
  • 用自己网站做淘宝客aso优化贴吧