#将字符串格式化为时间格式
$dateTimeStr = '20141231T23:59:59'
$format = 'yyyyMMddTHH:mm:ss'
$formatProvider = [Globalization.CultureInfo]::InvariantCulture
[datetime]::ParseExact($dateTimeStr,$format,$forma
原创
2021-08-23 10:50:09
493阅读
获取脚本当前所在路径:
$CurrentPath = $MyInvocation.MyCommand.Path.substring(0,$MyInvocation.MyCommand.Path.LastIndexOf('\')+1)$today = Get-Date -UFormat "%Y%m%d"$LogFilePath = $CurrentPath+"Result_$today.txt"
g
原创
2021-08-23 11:05:54
119阅读
HANDLE SetClipboardData(UINT uFormat, HANDLE hMem);Parameters格式: [in] Unsigned integer that specifies a clipboard fny of the standard cli
原创
2022-10-20 10:44:45
205阅读
function dgmdate($timestamp, $format = 'dt', $timeoffset = '9999', $uformat = '') { global $_G; $format == 'u' && !$_G['setting']['dateconvert'] && $format = 'dt'; static $dformat, $tformat, $dtformat, $offset, $lang; if($dforma
原创
2021-08-05 15:51:13
197阅读
调用WinAPI实现剪切板操作的函数:BOOL OpenClipboard(HWND hWndNewOwner); //打开剪切板
BOOL EmptyClipboard(VOID); //清空剪切板
HANDLE SetClipboardData(UINT uFormat, HANDLE hMem); //设置剪切
$Res_Path = "d:\temp\"
$Time = Get-Date -UFormat "%Y%m%d%H%M"
$ComputerName = $env:computername
$IP = ((gwmi win32_networkadapterconfiguration | ? {$_.DefaultIPGateway -ne $null}).IPAddress)[0]
原创
2023-11-23 09:25:24
84阅读
DrawText函数原型:int DrawText(
HDC hDC, // handle to DC
LPCTSTR lpString, // text to draw
int nCount, // text length
LPRECT lpRect, // formatting dimensions
UINT uFormat // text-drawing options
);先看看实现吧:M
DrawText函数简介 这个函数的作用非常easy,就是在指定的区域内输出格式化的文本。 函数原型:int DrawText( HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UNIT uFormat); hDC是设备上下文句柄。...
转载
2015-02-21 18:00:00
98阅读
2评论
DrawText函数简介 这个函数的作用非常easy,就是在指定的区域内输出格式化的文本。 函数原型:int DrawText( HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UNIT uFormat); hDC是设备上下文句柄。...
转载
2014-08-03 17:36:00
41阅读
DrawText函数简介 这个函数的作用非常easy,就是在指定的区域内输出格式化的文本。 函数原型:int DrawText( HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UNIT uFormat); hDC是设备上下文句柄。...
转载
2015-06-04 15:06:00
154阅读
2评论
编写公共函数,然后将其保存为D:\temp\Send.psm1,脚本内容如下:
Function SendMsg($touser,$data){
$url='http://msg.xx.com/rmsg'
$key = 'Mj111'
$secret = 'b3228'
$today = Get-Date -uformat "%YY-%M-%D"
原创
2021-08-23 10:58:34
827阅读
Add-PSSnapin -Name *vmware*
$date = get-date -UFormat %y%m%d
$vcenterlist = "vcenter1","vcenter2","vcenter3","vcetner4"
$username = Read-Host("input&n
原创
2017-03-15 09:55:59
2232阅读
1评论
该函数在指定的矩形里写入格式化的正文,根据指定的方法对正文格式化(扩展的制表符,字符对齐、折行等)。 int DrawText(HDC hDC, // 设备描述表句柄 LPCTSTR lpString, // 将要绘制的字符串 int nCount, // 字符串的长度 LPRECT lpRect, // 指向矩形结构RECT的指针 UINT uFormat // 正文的绘制选项
转载
2024-08-27 09:12:32
45阅读
最近某個客戶為了能夠在更新Windows 7母版之後,在不動到Studio的狀況下,每月能夠自動更新,因此為了這個需求寫了一個Powershell,並套進在Windows 2012的工作排成之中。先說明基本環境Hypervisor:XenServer 6.5OS:Windows 2012 R2虛擬桌面版本:Xendesktop7.6.3$Today=Get-Date -UFormat %Y%m%d
原创
2017-03-06 20:48:12
933阅读