2014年6月30日 星期一

Windows WMI的架構簡介

Windows Management Instrumentation (WMI)management data和操作Windows-based (OS)operating systemsinfrastructure 可以寫WMI scriptsapplications來自動化管理remote computers,但是WMI也支援operating system的其他部分和其他產品,如System Center Operations Manager、早期的Microsoft Operations Manager (MOM)Windows Remote Management (WinRM)

下圖顯示WMI infrastructure WMI providers and managed objects的關係,並且顯示WMI infrastructureWMI consumers之間的關係。
 WMI infrastructureWMI service (Winmgmtoperating system component)作為 management applicationsWMI data providersmediator he WMI repository 是一個WMI-related static data storage area
management application script 呼叫連接到一個WMI namespaceWMI service 開始執行。 WMI service經由COM interface management applications互動。

2014年6月27日 星期五

如何查看安裝的 .NET Framework 版本為何和是否有做update

可以參考MSDN的資料:

How to: Determine Which .NET Framework Versions Are Installed



Users can install and run multiple versions of the .NET Framework on their computers. When you develop or deploy your app, you might need to know which .NET Framework versions are installed on the user’s computer. Note that the .NET Framework consists of two main components, which are versioned separately:
  • A set of assemblies, which are collections of types and resources that provide the functionality for your apps. The .NET Framework and assemblies share the same version number.
  • The common language runtime (CLR), which manages and executes your app's code. The CLR is identified by its own version number (see .NET Framework Versions and Dependencies).

2014年6月25日 星期三

Auto logon(2):Create auto logon with WMI by using VB Script

''''''Sample code如下''''''''

'Set wshShell = WScript.CreateObject( "WScript.Shell" )
'strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
Set oNetwork = CreateObject("wScript.Network")
strComputerName=oNetwork.Computername         
strDefaultUserName="test6"
strDefaultPassword="pwd6"
strGroup="administrators"
strAutoAdminLogon="1"

2014年6月19日 星期四

Web(6) HTML +xml+ CSS的HELLO WORLD

經由CSS自訂文檔中的元素(XML 元素)的設置樣式,做一個簡單的"Hello world"程式。
l   結果如下:


2014年6月18日 星期三

Web(5) HTML +xml+ XSLT的HELLO WORLD

做一個簡單的"Hello world"程式。
結果如下:




Web(4) HTML +VB Script 的HELLO WORLD

做一個簡單的"Hello world"程式。
l   結果如下:



Web(3) HTML +Java Script 的HELLO WORLD

做一個簡單的"Hello world"程式。
結果如下:



Web(3) HTML +Java Script 的HELLO WORLD with Input Tag

Sample code 如下:
<html>
 <head>
<script type='text/javascript'>
function buttonClickHandler() {
        var userName = document.getElementById("nameInput").value;
        var greetingString = "Hello, " + userName + "!";
        document.getElementById("greetingOutput").innerText = greetingString;
}
</script>
 </head>

2014年6月16日 星期一

Auto logon(1):Create auto logon with WMI by using Power Shell Script


Step1、將以下的指令寫入文字編輯器,並存成"autologon.ps1

######宣告變數,$computer也可以為$computer="localhost
param (
  [Parameter(Mandatory=$false)][String[]]$computer = ".",
  [Parameter(Mandatory=$false)][String[]]$computerName = $env:computername,
  [Parameter(Mandatory=$false)][String]$DefaultDomainName = $env:USERDOMAIN,
  [Parameter(Mandatory=$false)][String]$DefaultUserName = "test",
  [Parameter(Mandatory=$false)][String]$DefaultPassword  = "pwd",
  [Parameter(Mandatory=$false)][String]$Group  = "administrators",
  [Parameter(Mandatory=$false)][Int]$AutoLogonCount
)

Web(2):HTML + CSS 的HELLO WORLD

<!--
XML 元素指的是從(且包括)開始標籤直到(且包括)結束標籤的部分。
元素可包含其他元素、文本或者兩者的混合物。元素也可以擁有屬性。
-->

l   Sample code 如下:
<html>
 <head>
  <style type="text/css">
   h1
   {
    font-family:Verdana, Arial;
    font-size:60px;
    margin-left:30px;
    color: red;
    display: block;
   }
  </style>
 </head>
 <body>
   <h1>Hello World!</h1>
 </body>
</html>

結果如下:



WEB(1):HTML的HELLO WORLD

html的註解方式<!--註解文字 -->
HTML 的註解是由角括號 < 開始,然後一個驚嘆號 ! ,接著兩個連續的破折號 -- ,接著是註解內容,結尾則是兩個連續的破折號 -- ,最後角括號 > 結束,例如
<!-- comment -->
註解可以是多行的,例如
<!-- <!DOCTYPE> 聲明位於文檔中的最前面的位置,處於 <html> 標籤之前。此標籤可告知流覽器文檔使用哪種 HTML XHTML 規範。
-->