2015年2月7日 星期六

主板診斷卡常見代碼及解決

診斷卡代碼     主板診斷卡常見代碼及解決
                   
一、常見代碼及解決:
    1: FF、00、01、02 狀態不跳變 CPU未工作
        推論:主板或CPU壞
    2:C1(或C開頭)、D3(或D開頭) CPU已工作正在尋找內存
        推論:內存壞、接觸不好
    3:C0、D1 狀態,CPU已發出尋址指令並已選中BIOS,但是BIOS沒有響應
        推論:BIOS、南橋、IO壞
    4:C1--C5循壞跳變(同D3--D5)
        推論:BIOS、IO芯片壞
    5:OB、26、31時一般可點亮,如不亮
        推論:顯卡、集成顯卡壞
    6:0B、26、31、42、48、4E、58、0D、6F、7F、85
              推論:表示主板能點亮,正檢查顯卡和鍵盤鼠標口,如果仍不亮大多為顯卡壞

常出現的代碼而又出現此碼無解的主要是 75、C1、C0、EF
解釋大概如下
     75正在掃瞄硬件配置,查硬盤,光驅設備及相關接口設備和接線有否有故障
     C1或C0內存故障
     EFbios故障,需要對cmos進行放電操作
     如果一開機檢查卡只有電壓顯示而沒有代碼顯示,就檢查cpu是否有故障
                   
二、其他常用代碼:
1. 檢測卡跑00,CO,CF,FF或D1:
     原因:CPU插槽髒。針腳壞,接觸不好。CPU,內存超頻了。CPU供電不良。某芯片發熱,硬件某部分資源不正常,在CMOS裡把其關閉或更換該集成資源的芯片。
2. C1,C2,C6,C7或E1:
     內存接觸不良,(用鑷子劃)。
     測內存工作電壓(SDRAM 3.3V,DDR 2.5和1.6V。)
     測時鐘
     CPU旁排阻是否有損壞。
     測CPU地址線和數據線。
     北橋壞。
                   
3.C1~05循環跳變:
     BIOS損壞
     I/O壞或者南橋壞.
                   
4.C1,C3,C6:
     刷BIOS
     換電源,換CPU,換轉接卡有可以解決問題.
     檢查BIOS座.
     PCB斷線,板上粘有導電物.
     清洗內存和插槽.
     換內存條.換內存插槽.
     換I/O.北橋虛焊或者壞.
                   
5.循環顯示C1~C3.或者C1~C5等.
     刷BIOS.
     換I/O有時可解決問題.
     PCB斷線,板上粘有導電物.
     可考慮換電容.換CPU.換內存.
     南橋壞.
                   
6.顯BO代碼:
      看內存電壓,清CMOS,北橋壞.
                   
7.顯示25代碼:
      北橋問題.
                   
8.跑0D後不亮:
      外頻,倍頻跳線.
                   
9.顯2B代碼後不亮:
      刷BIOS.清除 BIOS.時鐘發生器不良.北橋供電不正常或者北橋壞.
                   
10.跑50代碼:
      I/O錯,南北橋,BIOS壞.
                   
11.跑41代碼:
      BIOS刷新.PCB壞或者上面有導電物.
                   
12.跑R6代碼:檢測不到顯卡.劃者是內存沒有過.
13.跑 R7代碼:顯卡初始化沒有完成.是內存錯,或者是顯卡沒有插好.清洗插槽.反覆插試內存.
14.跑E0代碼:CPU 沒有工作.插槽髒,針腳壞.
                   
                   
1、"C1"內存讀寫測試,如果內存沒有插上,或者頻率太高,會被BIOS認為沒有內存條,那麼POST就會停留在"C1"處。
2、"0D"表示顯卡沒有插好或者沒有顯卡,此時,蜂鳴器也會發出嘟嘟聲。
3、"2B"測試磁盤驅動器,軟驅或硬盤控制器出現問題,都會顯示"2B"。
4、"FF"表示對所有配件的一切檢測都通過了。但如果一開機就顯示"FF",這並不表示系統正常,而是主板的BIOS出現了故障。導致的原因可能有:CPU沒插好,CPU核心電壓沒調好、CPU頻率過高、主板有問題等。
                   
如果診斷卡的代碼跑00或FF停止,說明CPU還沒有開始工作,一般是CPU或主板的問題;

代碼從00 FF跑到C1或D3(BIOS不同跑的代碼不一定相同)說明CPU是好的,問題出在內存部分沒有工作,一般是內存的金手指或插槽髒了,或者主板給內存提供的工作條件不足,也就是說可能是主板壞了;

代碼從00 FF跑到26,一般來說如果顯卡和主板沒有問題的話,顯示器就應該點亮了;
如果代碼從00 FF跑到41,主機不亮,有很大的可能是BIOS壞了,要重新刷寫或更換BIOS。
診斷卡從00 FF代碼經過CI C3 05 07 13 26 (0B)41 43等等代碼後再次跑回00或FF,說明主板的啟動過程完畢,開始按照CMOS的設置進行引導。

2015年2月6日 星期五

LenB函數

VB.NET
Public Shared Function CharByte(ByVal vstrWord As String) As Integer
    'aStr字串之第一個字的位元組長度
    If Len(vstrWord) = 0 Then
        Return 0
    Else
        Select Case Asc(vstrWord)
            Case 0 To 255
                Return 1
            Case Else
                Return 2
        End Select
    End If
End Function

Public Shared Function StrLenB(ByVal vstrValue As String) As Integer
    '如同VB 6.0的LenB函數,傳回字串aStr的位元組長度
    Dim i, k As Integer
    For i = 1 To Len(vstrValue)
        k += CharByte(Mid(vstrValue, i, 1))
    Next
    Return k
End Function

MessageBox.Show(StrLenB("a").ToString()) 'return 1
MessageBox.Show(StrLenB("abc").ToString()) 'return 3
MessageBox.Show(StrLenB("a亂").ToString()) 'return 3
MessageBox.Show(StrLenB("a亂b").ToString()) 'return 4

C#
public static int CharByte(string vstrWord)
{
    //aStr字串之第一個字的位元組長度
    if (vstrWord.Length  == 0)
    {
        return 0;
    }
    else
    {
        if(Convert.ToInt32(vstrWord[0]) > 255){
            return 2;
        }else{
            return 1;
        }
    }
}

public static int StrLenB(string vstrValue)
{
    //如同VB 6.0的LenB函數,傳回字串aStr的位元組長度
    int i = 0;
    int k = 0;
    for (i =0; i < vstrValue.Length ; i++)
    {
        k += CharByte(vstrValue.Substring( i, 1));
    }
    return k;
}

MessageBox.Show(StrLenB("a").ToString()); //return 1
MessageBox.Show(StrLenB("abc").ToString()); //return 3
MessageBox.Show(StrLenB("a亂").ToString()); //return 3
MessageBox.Show(StrLenB("a亂b").ToString()); //return 4

2015年1月29日 星期四

取得本機上所有的IP

VB.NET程式如下,
'取得本機上所有的IP Address
Dim num As Integer = 1
Dim ipAddressList As System.Text.StringBuilder = New System.Text.StringBuilder
For Each nic As System.Net.NetworkInformation.NetworkInterface 
    _ In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
    For Each ipInfo As System.Net.NetworkInformation.IPAddressInformation 
        _ In nic.GetIPProperties().UnicastAddresses
        '取得IP Address
        ipAddressList.Append("IP #" & num & ": " & ipInfo.Address.ToString() & vbCrLf)
        num += 1
    Next

Next
MessageBox.Show("全部的IP:" & vbCrLf & ipAddressList.ToString())

'取得本機上ipv4及非Loopback的IP Address
ipAddressList.Clear()
num = 1
For Each nic As System.Net.NetworkInformation.NetworkInterface 
    _ In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
    For Each ipInfo As System.Net.NetworkInformation.IPAddressInformation 
        _ In nic.GetIPProperties().UnicastAddresses
        If System.Net.IPAddress.IsLoopback(ipInfo.Address) = False _
            AndAlso ipInfo.Address.AddressFamily <> Net.Sockets.AddressFamily.InterNetworkV6 Then
            '取得IP Address
            ipAddressList.Append("IP #" & num & ": " & ipInfo.Address.ToString() & vbCrLf)
            num += 1
        End If
    Next
Next
MessageBox.Show("只列出ipv4及非Loopback的IP:" & vbCrLf & ipAddressList.ToString())


C#程式如下,
//取得本機上所有的IP Address
int num = 1;
System.Text.StringBuilder ipAddressList = new System.Text.StringBuilder();
foreach (System.Net.NetworkInformation.NetworkInterface nic 
    in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
{
    foreach (System.Net.NetworkInformation.IPAddressInformation ipInfo 
        in nic.GetIPProperties().UnicastAddresses)
    {
        //取得IP Address
        ipAddressList.Append("IP #" + num + ": " + ipInfo.Address.ToString() +  Environment.NewLine );
        num += 1;
    }
}
MessageBox.Show("全部的IP:" + Environment.NewLine  + ipAddressList.ToString());

//取得本機上ipv4及非Loopback的IP Address
ipAddressList.Clear();
num = 1;
foreach (System.Net.NetworkInformation.NetworkInterface nic 
    in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
{
    foreach (System.Net.NetworkInformation.IPAddressInformation ipInfo 
        in nic.GetIPProperties().UnicastAddresses)
    {
        if (System.Net.IPAddress.IsLoopback(ipInfo.Address) == false 
            && ipInfo.Address.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6)
        {
            //取得IP Address
            ipAddressList.Append("IP #" + num + ": " + ipInfo.Address.ToString() +  Environment.NewLine );
            num += 1;
        }
    }
}
MessageBox.Show("只列出ipv4及非Loopback的IP:" +  Environment.NewLine  + ipAddressList.ToString());

2014年12月22日 星期一

網管指令

ping -a IP
nbtstat -a IP
netstat -an

netsh int ip reset resettcpip.txt


netsh winsock reset

2014年12月19日 星期五

MS SQL運用ROW NUMBER耶得區間資料

select * from (
SELECT ROW_NUMBER() OVER(ORDER BY seq DESC) AS Row,
    Material_Cname,lot
FROM Y
) xyz where Row between 100 and 200

2014年12月8日 星期一

網頁Refresh秒數控制

讓網頁Refresh

在網頁開發上有時會讓Client端的頁面定時的自動對Server提出Request,其實這有幾種方法可用,下面我僅列出一個常用的方法,但還是覺得儘量不要有這樣的設計以避免Server過於忙碌而Loading太重了。
在HTML的間加入下面這段標籤內容:
content="10     表示10秒鍾就會Refresh。
url=DirectorTo.aspx"       表示Refresh後要跳到哪一個頁面,若是原來頁面亦可填寫原頁面的位置。

2014年12月3日 星期三

How to Place .NET Windows Forms Control To ASP.NET Web Form

引用
Clearly Drawing in a windows form is easier, accessing data and the way data is displayed are much different, etc...
So to go about this, we will first create a simple Windows application, and I'll show you later on in this tutorial how I will embed it within our page. We will use Windows Control Library instead of a new Windows application.
Open up visual studio, press File-->New-->Project.
Choose "Windows Control Library" and leave the other default settings.
In the control library, insert a label into your form and save your changes.
Make sure you Debug the project because we will need the dll file produced to be used within our web application.
Now close the solution and create a new website.
To do so, press File-->New-->Website. Give your site a name. Mine is web_project.
Now you will need your dll file produced in the previous project, copied to where your asp.net website is.
Usually, you should locate your dll file in "bin" folder of your project. Copy that dll and place it in the root of the website.
Now go back to your website in visual studio, and get the HTML code of the Default.aspx page.
Add the following code within the "form" tag:

<object id="myName"classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1"
height="70" width="350" VIEWASTEXT/>
Save your changes and Run the site. An alert will be prompted to you asking wether to trust the dll file or not.
Click Run to allow the dll to be launched in Internet Explorer.
This will load the dll file to your web page. It should look something like image below: