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

一般网站建设都用什么字体网站建设流程和费用

一般网站建设都用什么字体,网站建设流程和费用,贵州省建设厅官网站首页,英文网站源码我们用.Net安装程序生成的快捷方式是这样的#xff0c;如下图#xff1a;该图中目标所对应的文本框是灰色的#xff0c;并且下方的查找目标和更改图标两个按钮也是不可用。这样我们根本就没有办法更改这个快捷方式。假如这时有个客户需要在程序启动的时候传入一些参数#…我们用.Net安装程序生成的快捷方式是这样的如下图  该图中目标所对应的文本框是灰色的并且下方的查找目标和更改图标两个按钮也是不可用。这样我们根本就没有办法更改这个快捷方式。假如这时有个客户需要在程序启动的时候传入一些参数那样我们根本就没有办法因为快捷方式不可编辑我们总不能让客户在CMD窗口启动吧这样我们就不能使用.Net提供的快捷方式。只能是自己建立快捷方式。那我们怎么建立快捷方式呢这里我们需要用到一个Com组件Windows Script Host Object Model这个组件就是帮助我们建立快捷方式的。首先我们先在启动项目中添加上引用如下图然后我们再在启动项目中添加一个安装程序类这个类的主要作用就是在程序进行安装和卸载的时候添加或者删除快捷方式。代码如下:  using System;using System.Collections.Generic;using System.ComponentModel;using System.Configuration.Install;using IWshRuntimeLibrary;using System.IO;namespace New{    [RunInstaller(true)]    public partial class MyInstaller : Installer    {        public MyInstaller()        {            InitializeComponent();        }        public override void Install(System.Collections.IDictionary stateSaver)        {            try            {                base.Install(stateSaver);                System.Reflection.Assembly Asm  System.Reflection.Assembly.GetExecutingAssembly();//获取当前程序集信息                System.IO.FileInfo fileinfo  new System.IO.FileInfo(Asm.Location);//获取当前程序集位置                string dbpath  fileinfo.DirectoryName;//获取文件夹名称                string name  fileinfo.Name;//获取文件名称                //去掉后缀                if (name.ToUpper().Contains(.EXE))                {                    name  name.ToUpper().Replace(.EXE, );                }                //在桌面创建快捷方式                WshShell shell  new WshShell();                IWshShortcut shortcut  (IWshShortcut)shell.CreateShortcut(                    Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)   \\   name   .lnk                    );                shortcut.TargetPath  Asm.Location;//目标                shortcut.WorkingDirectory  dbpath;//工作文件夹                shortcut.WindowStyle  1;//窗体的样式为默认为最大化为最小化                shortcut.Description  yangyang8848;//快捷方式的描述                shortcut.IconLocation  Asm.Location;//图标                shortcut.Save();                //在程序菜单中创建文件夹                if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Programs)   \\yangyang8848\\   name))                {                    Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Programs)   \\yangyang8848\\   name);                }                //在程序菜单中创建快捷方式                IWshShortcut shortcut2  (IWshShortcut)shell.CreateShortcut(                    Environment.GetFolderPath(Environment.SpecialFolder.Programs)   \\yangyang8848\\   name   \\   name   .lnk                    );                shortcut2.TargetPath  Asm.Location;                shortcut2.WorkingDirectory  dbpath;                shortcut2.WindowStyle  1;                shortcut2.Description  yangyang8848   -   name;                shortcut2.IconLocation  Asm.Location;                shortcut2.Save();            }            catch (Exception e)            {                System.Windows.Forms.MessageBox.Show(e.Message);            }        }        public override void Uninstall(System.Collections.IDictionary savedState)        {            base.Uninstall(savedState);            //卸载程序的时候将两个快捷方式删除            System.Reflection.Assembly Asm  System.Reflection.Assembly.GetExecutingAssembly();            System.IO.FileInfo fileinfo  new System.IO.FileInfo(Asm.Location);            string name  fileinfo.Name;            if (name.ToUpper().Contains(.EXE))            {                name  name.ToUpper().Replace(.EXE, );            }            if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Programs)   \\yangyang8848\\   name))            {                if (Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.Programs)   \\yangyang8848\\).Length  1)                {                    Directory.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Programs)   \\yangyang8848\\   name  \\, true);                }                else                {                    Directory.Delete(Environment.GetFolderPath(Environment.SpecialFolder.Programs)   \\yangyang8848\\, true);                }            }            if (System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)   \\   name   .lnk))            {                System.IO.File.Delete(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)   \\   name   .lnk);                            }        }    }} 利用上边的代码创建出来的快捷方式样式如下我们可以看到这个快捷方式目标处的文本框是可以编辑的并且按钮查找目标和更改图标也是可以编辑的。这样我们就可以在启动程序的时候通过快捷方式输出参数满足用户的需求。转载于:https://www.cnblogs.com/yuanermen/archive/2007/10/07/916447.html
http://www.yutouwan.com/news/207363/

相关文章:

  • 建设网站网址是多少跟黄聪学WordPress主题开发
  • 杭州网站建设报价网站文件服务器
  • 做与食品安全有关的网站百度助手下载
  • 国外做螺栓比较好的网站注册账号验证码平台
  • 手表哪个网站正品网络营销热点事件案例分析
  • 襄阳网站建设哪家好珠海市住房和建设局网站
  • h5网站开发公司张家口专业做网站公司
  • 华西医院网站开发WordPress站点添加ssl证书
  • 网站怎样制作广州建筑集团股份有限公司
  • 农家乐网站设计国外做饮用来源的网站
  • 宁夏免费建个人网站海外网站制作
  • 网站构成的基本结构大型门户网站开发
  • 关键词分类浙江seo推广
  • 一点科技官方网站网站开发网站开发设计
  • 安徽省建设部网站官网wordpress 插件卸载
  • 智趣游戏型网站开发微信公众平台小程序怎么用
  • 小程序模板代码个人如何优化网站有哪些方法
  • 甘肃金恒大建设有限公司网站上海小红书seo
  • 做安全宣传的是什么网站郑州社交网站开发
  • 做搜狗网站快速排名邢台装修网站建设
  • 建设部门户网站条例免费下载wordpress后台密码
  • asp网站改成phpaccess如何与网站连接数据库
  • 涟源市住房与城乡建设局网站wordpress ftp设置方法
  • 江门建设网站卧室室内装修设计网站
  • 做网站代码编辑工具网站虚拟主机租用
  • 揭阳网站制作维护品牌网站什么意思
  • 濮阳新闻综合频道网站国外最受欢迎的网站
  • 什么网站有设计视频整合营销策划名词解释
  • 济南网站建设q.479185700惠临沂专业网站建设公司
  • 换域名对网站的影响软文如何推广