2018年5月23日 星期三

Windows sysprep位置

路徑:C:\Windows\System32或是C:\Windows\SysWOW64的sysprep目錄

OptiPlex 5050 skylake cpu使用USB及UEFI模式安裝Windows7

1.設定BIOS,設定disabled Secure boot,開啟legacy mode.

2.使用refus製作可開機USB,檔案格式為FAT32,模式為GPT,ISO檔須含SP1

3.下載DELL DriversPack for Win7
http://en.community.dell.com/techcenter/enterprise-client/w/wiki/12241.optiplex-5050-windows-7-driver-pack

4.建立目錄D:\Drivers,裡面再建兩個子目錄,mount及USB

5.將下載的DriversPack解壓縮到D:\Drivers\USB目錄

6.從隨身碟裡的source將boot.wim及install.wim複製到D:\Drivers

7.更新boot.wim
dism /mount-wim /wimfile:boot.wim /index:2 /mountdir:mount 
dism /image:mount /add-driver:"USB" /recurse 
dism /unmount-wim /mountdir:mount /commit 

8.確定install.wim索引
dism /Get-WimInfo /WimFile:install.wim

9.更新install.wim
dism /image:mount /add-driver:"USB" /recurse
dism /unmount-wim /mountdir:mount /commit

10.將更新完的boot.wim及install.wim複製回隨身碟的
source目錄即可

參考文章:https://community.spiceworks.com/how_to/125921-how-to-add-drivers-manually-to-usb-drive-to-install-windows-using-a-usb-3-0-port





2018年5月7日 星期一

C#字串插入符號

\' for a single quote.
\" for a double quote.
\\ for a backslash.
\0 for a null character.
\a for an alert character.
\b for a backspace.
\f for a form feed.
\n for a new line.
\r for a carriage return.
\t for a horizontal tab.
\v for a vertical tab.
\uxxxx for a unicode character hex value (e.g. \u0020).
\x is the same as \u, but you don't need leading zeroes (e.g. \x20).
\Uxxxxxxxx for a unicode character hex value (longer form needed for generating surrogates).

2018年5月3日 星期四

PHP die() exit()用法

基本上兩者用法'幾乎相同
die(status)或exit(status)
當status裡的是字串時會顯示該字串然後終止程式
當status裡的是0則終止程式



2018年5月2日 星期三

PHP include、include_once與require、require_once

requireinclude基本上功能完全一樣,除了在處理失敗時會有不同,require再出錯時會產生E_COMPILE_ERROR級別的錯誤,導致程式停止運作而include只產生警告E_WARNING,程式會繼續執行

include_once與require_once則只會在程式中引入一次,可以避免多重引入產生的錯誤

2016年12月1日 星期四

Windows2008 Hyper-V可外連網路設定

在虛擬網路管理員中要選擇外部,建議和主機的網路卡分開會較好管理.

在OS安裝完畢之後,網路部份預設為網路介面卡,刪除後另外新增傳統網路介面卡,在虛擬主機中設定好IP等相關資料就可以上網

2016年11月6日 星期日

Asp.Net取得瀏覽器版本及OS版本

取得瀏覽器版本

System.Web.HttpBrowserCapabilities browser = Request.Browser;
    string s = "Browser Capabilities\n"
        + "Type = "                    + browser.Type + "\n"
        + "Name = "                    + browser.Browser + "\n"
        + "Version = "                 + browser.Version + "\n"
        + "Major Version = "           + browser.MajorVersion + "\n"
        + "Minor Version = "           + browser.MinorVersion + "\n"
        + "Platform = "                + browser.Platform + "\n"
        + "Is Beta = "                 + browser.Beta + "\n"
        + "Is Crawler = "              + browser.Crawler + "\n"
        + "Is AOL = "                  + browser.AOL + "\n"
        + "Is Win16 = "                + browser.Win16 + "\n"
        + "Is Win32 = "                + browser.Win32 + "\n"
        + "Supports Frames = "         + browser.Frames + "\n"
        + "Supports Tables = "         + browser.Tables + "\n"
        + "Supports Cookies = "        + browser.Cookies + "\n"
        + "Supports VBScript = "       + browser.VBScript + "\n"
        + "Supports JavaScript = "     + 
            browser.EcmaScriptVersion.ToString() + "\n"
        + "Supports Java Applets = "   + browser.JavaApplets + "\n"
        + "Supports ActiveX Controls = " + browser.ActiveXControls 
              + "\n";



取得OS版本
Use Request.UserAgent
if (Request.UserAgent.IndexOf("Windows NT 5.1") > 0)
{
//xp
}
else if (Request.UserAgent.IndexOf("Windows NT 6.0") > 0)
{
//VISTA
}
else if (Request.UserAgent.IndexOf("Windows NT 6.1") > 0)
{
//7
}
else if (Request.UserAgent.IndexOf("Windows NT 6.2") > 0) 
{ 
//8
}
else if (Request.UserAgent.IndexOf("Windows NT 6.3") > 0) 
{ 
//8.1
}
else if (Request.UserAgent.IndexOf("Windows NT 10.0") > 0) 
{ 
//10
}