通过文件管理器直接访问 \\wsl$ 编辑linux子系统文件时提示文件拒绝访问。
原因是因为你启动linux的非管理员账号
解决方法
如果是这样的话,需要修改默认登录用户为root即可,修改方式如下:
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\debian.exe config --default-user root
修改完成后重启wsl,如下:
关闭wsl:wsl --shutdown
之后,在重新启动wsl
希望世间永无欺骗
通过文件管理器直接访问 \\wsl$ 编辑linux子系统文件时提示文件拒绝访问。
原因是因为你启动linux的非管理员账号
解决方法
如果是这样的话,需要修改默认登录用户为root即可,修改方式如下:
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\debian.exe config --default-user root
修改完成后重启wsl,如下:
关闭wsl:wsl --shutdown
之后,在重新启动wsl
imvirt
http://micky.ibh.net/~liske/imvirt.html
virt-what
https://people.redhat.com/~rjones/virt-what/
另外,wsl下执行“lsb_release -a”查看发行版本,会提示:“lsb_release: command not found”
执行命令安装 lsb_release
apt-get install -y lsb-release
Adobe宣布计划在2020年底停止支持Flash。
20年来,Flash一直在帮助您塑造在网络上玩游戏、观看视频和运行应用程序的方式。但是在过去的几年里,flash已经不那么常见了。三年前,80%的桌面Chrome用户每天访问一个带有Flash的网站。今天的使用率只有17%,而且还在继续下降。
这一趋势表明,网站正在向比Flash更快、更节能的开放式Web技术转移。它们也更安全,因此在购物、银行或阅读敏感文档时更安全。它们也可以在移动和桌面上工作,所以你可以在任何地方访问你最喜欢的站点。
这些开放式Web技术在去年年底成为Chrome的默认体验,当时网站开始需要请求您的许可才能运行Flash。在接下来的几年里,Chrome将继续逐步淘汰Flash,首先是请求您允许在更多情况下运行Flash,最后在默认情况下禁用它。到2020年底,我们将把flash完全从chrome中删除。
如果你今天经常访问一个使用flash的网站,你可能会想知道这对你有何影响。如果网站迁移到开放式Web标准,除了不再看到在该网站上运行flash的提示外,您不应该注意到有什么不同。如果站点继续使用flash,并且您授予站点运行flash的权限,那么它将一直工作到2020年底。
为了确保网络准备好无闪存,需要与Adobe、其他浏览器和主要发行商密切合作。我们支持Adobe今天的声明,我们期待着与所有人合作,使网络变得更好。
NTP时间服务器
pool.ntp.org: public ntp time server : https://www.ntppool.org/zh/
pool.ntp.org 是一个以时间服务器的大虚拟集群为上百万的客户端提供可靠的 易用的 网络时间协议(NTP)服务的项目
NTP池正在为世界各地成百上千万的系统提供服务。 它是绝大多数主流Linux发行版和许多网络设备的默认“时间服务器”
国内NTP服务 http://ntp.org.cn/pool.php
Windows 可以使用系统内置的ntp客户端: 以管理员权限在命令行运行如下指令:
w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org"
这在Windows 2003及之后的版本中被支持。 如果您使用旧版的Windows,您可以尝试如下指令:
net time /setsntp:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org"
作为管理员,右键任务栏的时钟,选择“更改日期和时间设置…”,并且在“Internet时间”选项卡下输入服务器名也能达到同样的效果。
在 管理NuGet程序包 中更新程序包,出现:
Failed to initialize the PowerShell host. If your PowerShell execution policy setting is set to AllSigned, open the Package Manager Console to initialize the host first
1. Step
Open Windows PowerShell
, run as Administrator
2. Step
Setting an execution policy to RemoteSigned or Unrestricted should work. It must be changed under an administrator mode via a PowerShell console. Be aware that changes will be applied according to the bit version of the PowerShell console, so 32bit or 64 bit. So if you want to install a package in Visual Studio (32 bit version) which requires a specific policy you should change settings of the policy via PowerShell (x86). The command in PowerShell (as administrator) to set the policy to unrestricted (as noted by @Gabriel in the comments) is:
|
OR
NuGet is using the 32 bit console, so it wont be affected by changes to the 64 bit console. Run the following script to make sure you are configuring the 32 bit console.
start-job { Set-ExecutionPolicy RemoteSigned } -RunAs32 | wait-job | Receive-Job
3. Step
Restart Visual Studio
————————————————————-
如果所有的政策是正确的,但安装包时,仍有错误
无法初始化PowerShell主机。如果你的PowerShell执行策略设置为使用AllSigned,打开包管理器控制台首先初始化主机。
该解决方案: 卸载 NuGet包管理器 插件,并重新安装它。
几年来这个问题就一直存在。从注册ftp.so起发现的。
在Windows下,浏览器地址栏中输入不加HTTP协议的网址:“ftp.so”,回车后,浏览器总会把它自动修改为 “ftp://ftp.so/”。
在IE,Chrome,Opera,Edge,Firefox中,都测试,结果都是一样的。
先后给 Google Chrome,微软,Mozilla 等报告过问题,但从没收到过回应。
感觉所有浏览器的自动修正方法都是相同的,所以这也许是个某组织的问题比如:W3C.org。
更新备注:Chrome 2018年已经修正
项目中有一个生日短信提醒功能,需要每年提醒。选农历, 每年提醒, 第二年的公历是不一样的,所以每一年的都需要自己计算。
设计的要求 ,他们说因为年纪大的人是只记得农历的。。。
正确的方法是,要先计算当年农历生日之前的月份有没有闰月,
有了就 直接构造农历日期对象是就把农历的月+1 为9月:
只要明白闰月这一点,其实就很简单了!
/////////// //公历转农历 /////////// DateTime date = Convert.ToDateTime(textBox1.Text); //格式:2000-1-1 ChineseLunisolarCalendar cc = new ChineseLunisolarCalendar(); if (date > cc.MaxSupportedDateTime || date < cc.MinSupportedDateTime) MessageBox.Show("参数日期时间不在支持的范围内,支持范围:"+cc.MinSupportedDateTime.ToShortDateString()+"到"+cc.MaxSupportedDateTime.ToShortDateString()); int year = cc.GetYear(date); int month = cc.GetMonth(date); int dayOfMonth = cc.GetDayOfMonth(date); int leapMonth = cc.GetLeapMonth(year); bool isLeapMonth = cc.IsLeapMonth(year, month); bool isLeapYear = cc.IsLeapYear(year); if (isLeapMonth || isLeapYear && month >= leapMonth) month -= 1; textBox2.Text = string.Concat(year, "-", month, "-", dayOfMonth);
/////////// //农历转公历 /////////// ChineseLunisolarCalendar cc = new ChineseLunisolarCalendar(); DateTime date = Convert.ToDateTime(textBox2.Text); //格式:2000-1-1 int MonthsInYear = cc.GetMonthsInYear(date.Year); int LeapMonth = cc.GetLeapMonth(date.Year, 1); bool isLeapMonth = cc.IsLeapMonth(date.Year, date.Month); bool isLeapYear = cc.IsLeapYear(date.Year); if (isLeapMonth) date = cc.ToDateTime(date.Year, date.Month - 1, date.Day, 0, 0, 0, 0); else if(date.Month > LeapMonth) date = cc.ToDateTime(date.Year, date.Month + 1, date.Day, 0, 0, 0, 0); else date = cc.ToDateTime(date.Year, date.Month, date.Day, 0, 0, 0, 0); textBox1.Text = date.ToString("yyyy-MM-dd");
这是一个WinForm做的的实例Demo: WindowsFormsApplication1
公司在阿里云的新服务器,系统C盘只有40G,装了一堆程序,配置好环境,只剩下大约3个G了,看着标红的C盘容量条,很不惬意,确定要清理一下。
习惯性手工清理 + CCleaner 清理,完了没有大多少。却发现Server 2012怎么没有“磁盘清理”这个功能按钮呢?
于是搜索引擎。。。
结果是,要在“服务器管理器”中打开勾选这个功能:
安装以后在磁盘属性页就可以找到“磁盘清理”的选项了!
方法一(推荐):开始菜单 ,在开始搜索框中 输入“疑难解答”
弹出疑难解答菜单 ,在系统和安全性一栏中 单击“使用Windows Update 解决问题” 单击下一步,系统会自动修复windows update的错误 (以下步骤等同方法二)
方法二:
开始菜单 ,单击“控制面板”
在“控制面板”中,单击查看方式,选择“大图标”(或者“小图标”)
向下翻,找到“疑难解答”
在系统和安全性一栏中 单击“使用Windows Update 解决问题” 单击下一步,系统会自动修复windows update的错误
特别补充步骤,控制面板 打开网络和Internet ,Internet选项,“连接”选项卡 单击局域网设置按钮,去掉“自动检测设置”前的√, 保证这三个勾都没有选中
这样可以大大提高windows update的成功率(尤其是装好MSDN原版系统后 ,首次更新时可修复代理)
重新启动电脑,一般情况下windows update就恢复正常了
【END】
在库内查询,可用于生成如下字段结构:
[表], [字段], [数据类型], [允许为空], [主键], [外键], [引用表], [说明描述]
SELECT TOP (100) PERCENT a.name AS 表, b.name AS 字段, c.name AS 数据类型, CASE WHEN b.isnullable = 0 THEN '-' WHEN b.isnullable = 1 THEN '是' END AS 允许为空,
CASE WHEN d .name IS NULL THEN '-' WHEN d .name IS NOT NULL THEN '是' END AS 主键, CASE WHEN e.parent_object_id IS NULL THEN 0 ELSE 1 END AS 外键,
CASE WHEN e.parent_object_id IS NULL THEN '-' ELSE g.name END AS 引用表, CASE WHEN h.value IS NULL THEN '-' ELSE h.value END AS 说明描述,
i.text AS 默认值
FROM sys.sysobjects AS a INNER JOIN
sys.syscolumns AS b ON a.id = b.id INNER JOIN
sys.systypes AS c ON b.xtype = c.xtype LEFT OUTER JOIN
(SELECT so.id, sc.colid, sc.name
FROM sys.syscolumns AS sc INNER JOIN
sys.sysobjects AS so ON so.id = sc.id INNER JOIN
sys.sysindexkeys AS si ON so.id = si.id AND sc.colid = si.colid
WHERE (si.indid = 1)) AS d ON a.id = d.id AND b.colid = d.colid LEFT OUTER JOIN
sys.foreign_key_columns AS e ON a.id = e.parent_object_id AND b.colid = e.parent_column_id LEFT OUTER JOIN
sys.objects AS g ON e.referenced_object_id = g.object_id LEFT OUTER JOIN
sys.extended_properties AS h ON a.id = h.major_id AND b.colid = h.minor_id LEFT OUTER JOIN
sys.syscomments AS i ON b.cdefault = i.id
WHERE (a.type = 'U') AND (c.name <> 'sysname')
ORDER BY 表, 字段
还有一个查全库表字段的,参见另一篇 《通过(sys.sysobjects)对象表,查询全库表的基础信息 :Sql Server 查询全库表信息》