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

大余做网站公司网络营销案例实例

大余做网站公司,网络营销案例实例,信科网络广州建网站,做外贸网站怎么做1、准备ico格式图标 star_bethlehem_icon 文件名改为star.ico 2、安装VSCode 如何下载安装VSCode 扩展:PowerShell扩展 3、创建项目 1、运行PowerShell命令 mkdir trayicon_ps1;cd trayicon_ps1;New-Item trayicon.ps1;code .2、将star.ico放入trayicon_ps1文…

1、准备ico格式图标

star_bethlehem_icon
在这里插入图片描述
文件名改为star.ico

2、安装VSCode

如何下载安装VSCode
扩展:PowerShell扩展

3、创建项目

1、运行PowerShell命令

mkdir trayicon_ps1;cd trayicon_ps1;New-Item trayicon.ps1;code .

2、将star.ico放入trayicon_ps1文件夹

4、修改trayicon.ps1的编码

选择文件trayicon.ps1
点击右下角UTF-8
在这里插入图片描述
选择通过编码保存
在这里插入图片描述
选择UTF-8 with BOM
在这里插入图片描述

5、编辑trayicon.ps1

# 脚本文件编码为UTF8 with BOM才能支持中文# 加载WinForms程序集
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName PresentationFramework# 图标文件路径要使用完整的路径。
$iconPath = "$(Get-Location)/star.ico"
$tooltip = "这是文字"# 右键菜单
$contextMenu = [System.Windows.Forms.ContextMenuStrip]::new()$menuItemMsg = [System.Windows.Forms.ToolStripMenuItem]::new()
$menuItemMsg.Text = "弹出消息框"
$menuItemMsg.add_Click({ [System.Windows.MessageBox]::Show('这是消息框') })
$null = $contextMenu.Items.Add($menuItemMsg)$menuItemExit = [System.Windows.Forms.ToolStripMenuItem]::new()
$menuItemExit.Text = "退出"
$menuItemExit.add_Click({ $script:done = $true }) # 单击菜单项时,将$done设置为$true。
$null = $contextMenu.Items.Add($menuItemExit)# 构造NotifyIcon对象。
$notifyIcon = [System.Windows.Forms.NotifyIcon]::new()
$notifyIcon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($iconPath)
$notifyIcon.Text = $tooltip
$notifyIcon.Visible = $true
$notifyIcon.ContextMenuStrip = $contextMenu
$notifyIcon.add_Click({ param($evtSender, $evtArgs)if ($evtArgs.Button -eq [System.Windows.Forms.MouseButtons]::Left){[System.Windows.MessageBox]::Show("单击了图标")}
})# 定义一个变量,该变量表示是否应退出脚本,并从add_Click()事件处理程序设置为$true。
$done = $falseWrite-Verbose -Verbose @"
Adding a PowerShell icon to notification area (system tray).
Use the icon's context menu to quit this script, 
or press Ctrl-C in the console window.
"@# Loop
try {while (-not $done) {# 使WinForms处理其事件。[System.Windows.Forms.Application]::DoEvents()# 睡一会儿,保持用户界面的响应。# 理论上可以在这里执行其他任务,只要它们快速完成,以便仍然允许足够频繁的DoEvents()调用。Start-Sleep -MilliSeconds 100}
}
finally {# 处理通知图标,删除图标。$notifyIcon.Dispose()Write-Verbose -Verbose 'Exiting.'
}

6、最终效果

点击右上角三角图标运行脚本
在这里插入图片描述
鼠标悬浮效果
在这里插入图片描述
鼠标单击效果
在这里插入图片描述
鼠标右键效果
在这里插入图片描述
弹出消息框按钮效果
在这里插入图片描述
退出按钮就是退出,没啥效果

7、不显示powershell窗口的方式

新建start.vbs

set ws=createobject("wscript.shell")
ws.Run "powershell.exe .\trayicon.ps1" , 0, False

双击运行即可

http://www.mmbaike.com/news/88622.html

相关文章:

  • 海珠区pc端网站建设广州网站推广服务
  • 百度宣传广告要多少钱成都谷歌seo
  • 学院网站规划方案app运营方案策划
  • 中央纪委网站 举报 要这么做才有效seo入门讲解
  • 探测网站是什么程序做的找网络公司做推广费用
  • 学销售去哪个学校最好seo培训班 有用吗
  • 网站增加关键字网站流量监控
  • 安阳做网站哪家好友情链接对网站的作用
  • 大气红色礼品公司网站源码企业推广策略
  • 网站宜昌临沂seo公司
  • 网站建设honmau搜索引擎广告形式有
  • 南宁会员网站制作最新的疫情最新消息
  • 集团网站建设特色推广模式包括哪些模式
  • 企业专业网站建设无锡seo公司找哪家好
  • 南宁软件优化网站建设推广普通话绘画
  • 网站运营方式提高网站排名的软件
  • 国家高新技术企业证书图片吉林seo关键词
  • 微同步网站全网推广外包公司
  • 网站带支付源码百度快照和广告的区别
  • 广东网站设计有名的公司抖音营销
  • 网站建设方案及报价seo优化工作怎么样
  • 怎么样自己做企业网站网络推广价格
  • 网站建设方案书 备案海淀区seo搜索引擎优化企业
  • 做网站用微信收款还是支付宝网站推广应该怎么做?
  • 临海手机网站市场营销计划书模板
  • 专业沈阳网站建设济南seo外包公司
  • 黄山家居网站建设怎么样百度免费优化
  • 现在网站开发技术有哪些网络营销整合营销
  • 用phpcms建站的网站电商平台链接怎么弄
  • 八年级信息所用软件做网站谷歌怎么推广自己的网站