Windows2003 on Virtual PC

Posted by on | | 0 意見
今天正式開始Virtual PC, 來灌個windows 2003好了!

灌好之後遇到幾個問題,
第1個:如何和實體主機共享資料夾呢?雖然選單中,Edit --> Setting中有個share folder的設定項目,可是一直是反白的,無法操作,後來查到要先安裝"Install Or Update Virtual Machine Additions",在選單位置為,Action --> Install Or Update Virtual Machine Additions,然後就可以設定囉!

第2個:如何在VPC播放音樂呢?
發現音效卡是sound blaster 16,可是找不到driver,怎辦?
發現一篇文章,http://kb.vmware.com/selfservice/viewContent.do?externalId=1115&sliceId=1
安裝步驟如下:

  1. Insert a Windows 2000 CD-ROM, then open a Command Prompt window and navigate to the i386 directory.
  2. Run the following two commands to extract the needed files:
    expand driver.cab -f:ctlsb16.sys c:\windows\temp
    expand wdma_ctl.in_ c:\windows\temp\wdma_ctl.inf
  3. Choose Control Panel>Add New Hardware, then click Next.
  4. When prompted, answer Yes, I've already connected the hardware.
  5. Select Add a new hardware device from the list, then click Next.
  6. Select Install the hardware that I manually select, then click Next.
  7. Select Sound, video and game controllers, then click Next.
  8. Click Have Disk and browse to C:\Windows\temp.
  9. Click wdma_ctl.inf and follow the prompts, choosing to install the unsigned driver.
  10. Choose Start>Settings>Control Panel, then open Sounds & Audio. Select Enable Windows audio.

原來非同步作業時,不能呼叫.....

Posted by on | | 0 意見
近來一直在學如何在asp.net網頁,執行非同步呼叫的動作。
這二天,一直再修改某個頁面程式,因為要非同步的寄出email,可是不知怎的,email一直寄不出去,看來看去,程式應該沒有寫錯,也沒有error產生,到底是怎麼一回事呢?

努力的k code,發現前人加了一句
response.end()
嗯,這應該是停止所有的回應,我想可能非同步的動作也會停止吧!
果真,改寫後,email就寄出去啦!

心想,這書上沒有教,也查不到相同的情況的例子,若沒有猜到是那個原因的話,那.....我要搞多久啊?????

ASP.NET非同步網頁

Posted by on | | 0 意見
在asp.net web page非同步的寫法有二種,我常用的這一種,覺得比較彈性。
有幾個重點步驟,如下:
  1. 建立一個真的要執行任務的function - ex. myAction
  2. 建立一個AsyncTaskDelegate物件 - ex. ATDObj
  3. 建立3個非同步必要的function - onBegin,onEnd,onTimeout
  4. 在web page註冊非同步的任務 - ex. myReg


所以執行順序為:myReg -> onBegin -> ATDObj -> myAction

底下的範本Code:
public class DATA
{
public string a;
public string b;
}

private void myAction(DATA  inDATA)
{
//do something
}

private  delegate void AsyncTaskDelegate(DATA  inDATA);

public IAsyncResult onBegin(object sender, EventArgs e, AsyncCallback cb, object state)
{
        AsyncTaskDelegate _dlgt = new AsyncTaskDelegate(myAction);
        return _dlgt.BeginInvoke((DATA)state, cb, state);
}

public void onEnd(IAsyncResult ar)
{}

public void onTimeout(IAsyncResult ar)
{}

private void Asnyc_NotifyGuest(string inGuestID)
{
DATA tmpData = new DATA();
        tmpData .a= "xxxx";
        tmpData .b= "yyyy";

        this.Page.RegisterAsyncTask(new PageAsyncTask(this.onBegin,
           this.onEnd,
           this.onTimeout,
           tmpData ,
           true
       ));
}