全局搜索结果(10)

  • 技术文摘不用写一句sql的ORM框架,支持多种数据库
  • 2021/4/12 11:59:22
  • 一、文件说明       Xk.Common.dll:框架周边的一些帮助类       Xk.ORM.dll:框架核心二、开始使用    1、简单粗暴的配置模式Cs类中:public static readonly DbSession DbHelper = new DbSession("MySqlConn");Web.config中:<add name="MySqlConn" providerName="Xk.ORM.MySql" connectionString="server=127.0.0.1;database=ormcms;uid=root;pwd=abc123123;oldsyntax=true;charset=utf8;Allow Zero Datetime=True;port=3306;" />    2、定义一个类文件(这个文件可以自己用代码生成器生成,后面会开放下载)//------------------------------------------------------------------------------ // // 此代码由工具生成: // 生成时间:2021/3/17 // 创建人:XuKai // using System; using Xk.ORM; namespace CMS.Models { /// /// *实体类:ktcfriendlink /// [Table("ktcfriendlink")] [Serializable] public partial class Ktcfriendlink : Entity { #region Model private int _Id; /// /// 主键id /// [Field("id")] public int Id { get { return _Id; } set { this.OnPropertyValueChange("id"); this._Id = value; } } private string _Title; /// /// 友链标题 /// [Field("title")] public string Title { get { return _Title; } set { this.OnPropertyValueChange("title"); this._Title = value; } } private string _Desc; /// /// 描述 /// [Field("desc")] public string Desc { get { return _Desc; } set { this.OnPropertyValueChange("desc"); this._Desc = value; } } private string _Url; /// /// 友链地址 /// [Field("url")] public string Url { get { return _Url; } set { this.OnPropertyValueChange("url"); this._Url = value; } } private int _Status; /// /// 1 通过,2 不通过,0 未审核 /// [Field("status")] public int Status { get { return _Status; } set { this.OnPropertyValueChange("status"); this._Status = value; } } private DateTime _Createtime; /// /// 创建时间 /// [Field("createtime")] public DateTime Createtime { get { return _Createtime; } set { this.OnPropertyValueChange("createtime"); this._Createtime = value; } } private DateTime _Authtime; /// /// 审核时间 /// [Field("authtime")] public DateTime Authtime { get { return _Authtime; } set { this.OnPropertyValueChange("authtime"); this._Authtime = value; } } private string _Askdesc; /// /// 申请描述 /// [Field("askdesc")] public string Askdesc { get { return _Askdesc; } set { this.OnPropertyValueChange("askdesc"); this._Askdesc = value; } } private string _Imgurl; /// /// 友链图片封面 /// [Field("imgurl")] public string Imgurl { get { return _Imgurl; } set { this.OnPropertyValueChange("imgurl"); this._Imgurl = value; } } private int _Index; /// /// 排序 /// [Field("index")] public int Index { get { return _Index; } set { this.OnPropertyValueChange("index"); this._Index = value; } } private int _Isimg; /// /// 是否为图片链接,1 是,0 否(文本) /// [Field("isimg")] public int Isimg { get { return _Isimg; } set { this.OnPropertyValueChange("isimg"); this._Isimg = value; } } private string _Email; /// /// 对方的站点url /// [Field("email")] public string Email { get { return _Email; } set { this.OnPropertyValueChange("email"); this._Email = value; } } #endregion #region Method /// /// 获取实体中的主键列 /// public override Field[] GetPrimaryKeyFields() { return new Field[] { _.Id, }; } /// /// 获取列信息 /// public override Field[] GetFields() { return new Field[] { _.Id, _.Title, _.Desc, _.Url, _.Status, _.Createtime, _.Authtime, _.Askdesc, _.Imgurl, _.Index, _.Isimg, _.Email }; } /// /// 获取值信息 /// public override object[] GetValues() { return new object[] { this._Id, this._Title, this._Desc, this._Url, this._Status, this._Createtime, this._Authtime, this._Askdesc, this._Imgurl, this._Index, this._Isimg, this._Email }; } #endregion #region _Field /// /// 字段信息 /// public class _ { /// /// * /// public readonly static Field All = new Field("*", "ktcfriendlink"); /// /// 主键id /// public readonly static Field Id = new Field("id", "ktcfriendlink"); /// /// 友链标题 /// public readonly static Field Title = new Field("title", "ktcfriendlink"); /// /// 描述 /// public readonly static Field Desc = new Field("desc", "ktcfriendlink"); /// /// 友链地址 /// public readonly static Field Url = new Field("url", "ktcfriendlink"); /// /// 1 通过,2 不通过,0 未审核 /// public readonly static Field Status = new Field("status", "ktcfriendlink"); /// /// 创建时间 /// public readonly static Field Createtime = new Field("createtime", "ktcfriendlink"); /// /// 审核时间 /// public readonly static Field Authtime = new Field("authtime", "ktcfriendlink"); /// /// 申请描述 /// public readonly static Field Askdesc = new Field("askdesc", "ktcfriendlink"); /// /// 友链图片封面 /// public readonly static Field Imgurl = new Field("imgurl", "ktcfriendlink"); /// /// 排序 /// public readonly static Field Index = new Field("index", "ktcfriendlink"); /// /// 是否为图片链接,1 是,0 否(文本) /// public readonly static Field Isimg = new Field("isimg", "ktcfriendlink"); /// /// 对方的联系邮箱 /// public readonly static Field Email = new Field("email", "ktcfriendlink"); } #endregion } }     3、cuid操作int i = 0; DbHelper.From<Ktcfriendlink>();//查询表所有数据 DbHelper.From<Ktcfriendlink>().Where(t => t.Id == 1);//条件id为1的数据,参数遵循linq语法。 DbHelper.From<Ktcfriendlink>().Where(new WhereClip("id = 1"));//条件id为1的数据,WhereClip参数也有很多种写法。 Ktcfriendlink model = new Ktcfriendlink(); model.Title = "baidu"; model.Url = "www.baidu.com"; i = DbHelper.Insert(model);//插入一条数据 i = DbHelper.Delete(a => a.Id == 1);//删除id为1的数据 model.Title = "taobao"; i = DbHelper.Update(model); DbHelper.FromProc("procname");//可以执行存储过程 DbTrans trans = DbHelper.BeginTransaction();//执行事务 try { trans.Update(Ktcfriendlink._.Title, "google", a => a.Id == 1); trans.Update(Ktcfriendlink._.Title, "yahoo", a => a.Id == 2); trans.Commit();//提交事务 } catch { trans.Rollback();//回滚事务 } finally { trans.Close(); } Ktcfriendlink model = new Ktcfriendlink(); model.Title = "baidu"; model.Url = "www.baidu.com"; i = DbHelper.Insert(model);//插入一条数据 i = DbHelper.Delete(a => a.Id == 1);//删除id为1的数据 model.Title = "taobao"; i = DbHelper.Update(model); DbHelper.FromProc("procname");//可以执行存储过程 DbTrans trans = DbHelper.BeginTransaction();//执行事务 try { trans.Update(Ktcfriendlink._.Title, "google", a => a.Id == 1); trans.Update(Ktcfriendlink._.Title, "yahoo", a => a.Id == 2); trans.Commit();//提交事务 } catch { trans.Rollback();//回滚事务 } finally { trans.Close(); } DbHelper.From().Where(new WhereClip("id = 1"));//条件id为1的数据,WhereClip参数也有很多种写法。 Ktcfriendlink model = new Ktcfriendlink(); model.Title = "baidu"; model.Url = "www.baidu.com"; i = DbHelper.Insert(model);//插入一条数据 i = DbHelper.Delete(a => a.Id == 1);//删除id为1的数据 model.Title = "taobao"; i = DbHelper.Update(model); DbHelper.FromProc("procname");//可以执行存储过程 DbTrans trans = DbHelper.BeginTransaction();//执行事务 try { trans.Update(Ktcfriendlink._.Title, "google", a => a.Id == 1); trans.Update(Ktcfriendlink._.Title, "yahoo", a => a.Id == 2); trans.Commit();//提交事务 } catch { trans.Rollback();//回滚事务 } finally { trans.Close(); } DbHelper.From().Where(t => t.Id == 1);//条件id为1的数据,参数遵循linq语法。 DbHelper.From().Where(new WhereClip("id = 1"));//条件id为1的数据,WhereClip参数也有很多种写法。 Ktcfriendlink model = new Ktcfriendlink(); model.Title = "baidu"; model.Url = "www.baidu.com"; i = DbHelper.Insert(model);//插入一条数据 i = DbHelper.Delete(a => a.Id == 1);//删除id为1的数据 model.Title = "taobao"; i = DbHelper.Update(model); DbHelper.FromProc("procname");//可以执行存储过程 DbTrans trans = DbHelper.BeginTransaction();//执行事务 try { trans.Update(Ktcfriendlink._.Title, "google", a => a.Id == 1); trans.Update(Ktcfriendlink._.Title, "yahoo", a => a.Id == 2); trans.Commit();//提交事务 } catch { trans.Rollback();//回滚事务 } finally { trans.Close(); }框架后期整理好后开放下载,欢迎广大.net ORM爱好者使用
  • 评论:1 / 阅读:1414
  • 经验分享vs2019 安装时速度0kb,下载不了解决方案
  • 2021/4/14 15:17:03
  • vs2019安装无法进行
  • 问题:今天想装下高版本的vs,于是直接到官网下载了个vs2019 ,结果发现双击安装的时候一直卡住不动,提取文件速度0kb.解决方案:       关掉上面的下载窗口,到电脑网络适配器中,把正在用使的本地连接禁用后数秒重新启用,然后再次双击vs_community__4307803.1618383150.exe,会惊奇的发现居然可以下载了。       以上观点只是本人真实遇到的情况与解决方案,若解决不了您的问题,请另寻他法。
  • 评论:0 / 阅读:1265
  • 经验分享nuget中 Microsoft.NETCore.App/3.1 还原包超时问题
  • 2021/4/15 9:43:01
  • nuget未能还原引用包问题
  • ...包即可。如下图
  • 评论:0 / 阅读:1043
  • 经验分享win7下运行nodejs的npm命令报错Error: ENOENT
  • 2021/4/15 10:16:44
  • Error: ENOENT, stat 'C:\Users\Administrator\AppData\Roaming\npm'
  • ...Error: ENOENT, stat 'C:\Users\Administrator\AppData\Roaming\npm'】如下 出现上面错误表示指定的路径不存在,只用在C:\Users\Administrator\AppData\Roaming\下创建npm文件夹即可。创建好文件夹后再次输入npm指令回车。久违的nodejs系统提示出来了,问题解决。
  • 评论:0 / 阅读:1213
  • 经验分享vs 修改css格式化展示方式为一行
  • 2021/4/16 9:59:45
  • visual studio格式化css为一行显示
  • 一般情况下,vs IDE自动格式化css的样式为以下这种展示方式: body, p { font-family: sans-serif,fantasy; overflow: hidden; margin: 0; padding: 0; } .msg-container { margin: 90px; position: relative; }看上去结构比较清晰,但是当样式写多了,滚动条会很长,有时也挺麻烦的,那么怎么修改其格式化展示的方式呢?依次点击:工具=》选项=》文本编辑器=》css=》高级,进行如下设置即可。
  • 评论:0 / 阅读:1249
  • 经验分享win7 不重装系统c盘扩容的方法,亲测有效
  • 2021/4/20 16:00:41
  • c盘扩容,免重装系统增加c盘空间
  • 大家都有c盘太小的烦恼,可能是前期分期预判错误导致,也可能是后期软件安装默认路径忘改占用了大部分c盘等等。。如下,平常用到的大型软件太多,隔三差五清理磁盘都解决不了实质性问题,c盘总是爆红,看上去很不爽。于是大费周章给c盘进行扩容。扩容前如下:扩容后:操作步骤:1、首先要想扩容c盘那么必须将相邻的d盘清空,由于我d盘的数据比较重要,安装了n多软件,我又不想重装这些软件,只能想办法先将整个d盘转移到e盘,然后将d盘格式化,如下。(转移完成后部分已安装的软件快捷方式都会丢失,不用管它,后期会有恢复操作)。2、下载安装DiskGenius.exe软件,选中d分区右键=》删除当前分区,此时d分区变为“未分配状态”,点击c盘右键=》调整分区大小,选中未分配的d盘左右拖拽进行调整要扩容的分区大小,之后点击开始。3、后续按提示一直下一步就行,全部就绪后电脑会重启,直至c盘分区已扩容成功。4、最后一步将前期备份到e盘的数据恢复到d盘,如果扩容的时候已将整个d盘扩容到c盘,那么此时直接将e盘盘符修改为d盘即可。(修改盘符的方法:计算机右键=》管理=》存储=》磁盘管理=》选中e盘右键=》更改驱动器号和路径=》更改=》选d盘确定即可)
  • 评论:0 / 阅读:1072
  • 经验分享c#编写activeX控件详细教程
  • 2021/4/21 14:27:50
  • vs2012
  • 1、新建windows窗体控件库,命名为 MyActiveXDemo,打开Properties/AssemblyInfo.cs,修改为如下:2、打开工具箱,在自动生成的UserControl1.cs设计视图中添加一个button,如下图:3、双击button1,为按钮添加方法,这里演示只添加了一个弹出消息,如下private void button1_Click(object sender, EventArgs e) { MessageBox.Show("ActiveX Message."); }4、创建接口IObjectSafety.csusing System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; namespace MyActiveXDemo { [ComImport, GuidAttribute("CB5BDC81-93C1-11CF-8F20-00805F2CD064")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] public interface IObjectSafety { [PreserveSig] int GetInterfaceSafetyOptions(ref Guid riid, [MarshalAs(UnmanagedType.U4)] ref int pdwSupportedOptions, [MarshalAs(UnmanagedType.U4)] ref int pdwEnabledOptions); [PreserveSig()] int SetInterfaceSafetyOptions(ref Guid riid, [MarshalAs(UnmanagedType.U4)] int dwOptionSetMask, [MarshalAs(UnmanagedType.U4)] int dwEnabledOptions); } } 5、修改UserControl1.cs,使其继承接口IObjectSafety,完整的UserControl1.cs如下using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace MyActiveXDemo { [Guid("73D3BE6A-E3B3-46F7-AFFE-8673390DA3F6"), ProgId("ActiveXDemo.UserControl1"), ComVisible(true)] public partial class UserControl1 : UserControl, IObjectSafety { public UserControl1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MessageBox.Show("ActiveX Message."); } #region IObjectSafety 成员 格式固定 private const string _IID_IDispatch = "{00020400-0000-0000-C000-000000000046}"; private const string _IID_IDispatchEx = "{a6ef9860-c720-11d0-9337-00a0c90dcaa9}"; private const string _IID_IPersistStorage = "{0000010A-0000-0000-C000-000000000046}"; private const string _IID_IPersistStream = "{00000109-0000-0000-C000-000000000046}"; private const string _IID_IPersistPropertyBag = "{37D84F60-42CB-11CE-8135-00AA004BB851}"; private const int INTERFACESAFE_FOR_UNTRUSTED_CALLER = 0x00000001; private const int INTERFACESAFE_FOR_UNTRUSTED_DATA = 0x00000002; private const int S_OK = 0; private const int E_FAIL = unchecked((int)0x80004005); private const int E_NOINTERFACE = unchecked((int)0x80004002); private bool _fSafeForScripting = true; private bool _fSafeForInitializing = true; public int GetInterfaceSafetyOptions(ref Guid riid, ref int pdwSupportedOptions, ref int pdwEnabledOptions) { int Rslt = E_FAIL; string strGUID = riid.ToString("B"); pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA; switch (strGUID) { case _IID_IDispatch: case _IID_IDispatchEx: Rslt = S_OK; pdwEnabledOptions = 0; if (_fSafeForScripting == true) pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER; break; case _IID_IPersistStorage: case _IID_IPersistStream: case _IID_IPersistPropertyBag: Rslt = S_OK; pdwEnabledOptions = 0; if (_fSafeForInitializing == true) pdwEnabledOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA; break; default: Rslt = E_NOINTERFACE; break; } return Rslt; } public int SetInterfaceSafetyOptions(ref Guid riid, int dwOptionSetMask, int dwEnabledOptions) { int Rslt = E_FAIL; string strGUID = riid.ToString("B"); switch (strGUID) { case _IID_IDispatch: case _IID_IDispatchEx: if (((dwEnabledOptions & dwOptionSetMask) == INTERFACESAFE_FOR_UNTRUSTED_CALLER) && (_fSafeForScripting == true)) Rslt = S_OK; break; case _IID_IPersistStorage: case _IID_IPersistStream: case _IID_IPersistPropertyBag: if (((dwEnabledOptions & dwOptionSetMask) == INTERFACESAFE_FOR_UNTRUSTED_DATA) && (_fSafeForInitializing == true)) Rslt = S_OK; break; default: Rslt = E_NOINTERFACE; break; } return Rslt; } #endregion } } 6、右键项目MyActiveXDemo属性,      a、应用程序=》点击程序集信息=》勾选“使程序集COM可见”      b、生成=》勾选“为COM互操作注册”7、解决方案右键=》添加=》其它项目类型=》安装和部署,选中“InstallShield Limited Edition Project”,命名为“ActiveXSetup”,确定8、点击application files=》My Product Name=》右下角点击add Product Outputs,在弹出框内勾选“主输出”,确定,如下图9、右键ActiveXSetup,生成,成功后在ActiveXSetup\Express\DVD-5\DiskImages\DISK1下可以看到ActiveXSetup.msi安装程序,到这里就成功了一大半了。10、网上下载一个cabarc.exe,放在与ActiveXSetup.msi安装文件相同目录,下载地址:https://sqdownd.rbread05.cn/down/42010_20161130174135.rar,在相同目录创建一个install.inf文件,文件内容如下:[version] signature="$CHICAGO$" AdvancedINF=2.0 [Setup Hooks] hook1=hook1 [hook1] run=msiexec.exe /i "%EXTRACT_DIR%\ActiveXSetup.msi" /qn11、同时在同目录创建一个build.bat,内容如下:"cabarc.exe" n test.cab ActiveXSetup.msi install.inf 双击build.bat,执行完毕后将会生成一个test.cab文件,到此ActiceX控件已经打包好了。如何在浏览器上加载ActiveX控件?请看下一篇:asp.net 如何在网页上加载ActiveX控件
  • 评论:0 / 阅读:1134
  • 经验分享asp.net 如何在网页上加载ActiveX控件
  • 2021/4/21 15:49:02
  • ...x.aspx页面,将前面生成好的test.cab放到bin目录下。不知道test.cab怎么来的可以查看前一片文章:c#编写activeX控件详细教程3、在body中插入以下内容,<object id="mytt" classid="clsid:73D3BE6A-E3B3-46F7-AFFE-8673390DA3F6"                codebase="/test.cab"></object>如下图(注意classid一定要是前面UserControl1.cs定义的guid):4、运行(注意要用IE浏览器),弹出的插件提示,点允许即可,出现如下界面表示加载ok了。点击按钮button1,自然也会弹出控件对应的消息提示框了,如下至此,就是完整的.net编写ActiveX控件以及web加载ActiveX的教程了。
  • 评论:0 / 阅读:1281
  • 代码片段html+css+jquery 实现超帅留言墙效果!超帅,不喜勿喷!附完整demo
  • 2021/4/23 15:49:42
  • .../p>
  • 评论:72 / 阅读:2584
  • 经验分享uni-app发布H5提示The requested file was not found on this server.
  • 2021/4/27 13:47:04
  • HBuilderX 打包好uni-app并发布到网站服务器后提示The requested file was not found on this server,如下图:解决方案:1、修改manifest.json,将h5配置=》运行的基础路径修改为“h5/”,名称自己定,不要只默认的"./"就行,目录带有点会导致路由无法识别。修改前:2、将上图“./”的位置修改为"h5/",然后重新发行。3、完成后在unicloud控制台将默认页改成"h5/index",如下图:4、这个时候再用自己配置的网站域名去访问就可以了。效果如下:
  • 评论:0 / 阅读:1395