2008年8月17日 星期日

TeacherHelperY2008M08 [2008-08-17]

2008-08-17
Download TeacherHelperY2008M08 [2008-08-17] from Windows Live SkyDrive.

WJUsageCountHelperY2008M08 [2008-08-17-PM-03-30-25]

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_17_PM_03_30_56]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' -   -   -   -   -   -   -   -   -   -   -   -   -
' -   -   -   -   -   -   -   -   -   -   -   -   -
'     (著作權聲明) Copyright Statement:
'           Copyright 2000-2008, SoftHuman Corporation. All rights reserved.
'           善解科技股份有限公司
'           著作權 2000-2008。版權所有,保留一切權利。
'
'     (本段程式之目的) Purpose:
'           Object of this class can help you to manage Usage Count of an object, represented
'           by an ObjectID string.
'
'     (友善的模組名稱) Friendly name of this module:
'           [WJAtTSINT2008].[WJ Usage Count Helper Y2008M08]
'
'     (程式用模組名稱) Code name of this module:
'           WJAtTSINT2008.WJUsageCountHelperY2008M08
'
'     (本段程式是否已經在被使用中) In use: Yes
'     (程式撰寫的進度) Developing: 100% (Mandatory)
'     (程式堪用的程度) Workable: 80% (Threshold at 80%)
'     (程式的測試程度) Code tested: 80% (max 99%)
'
'     WJUsageCountHelperY2008M08 [2008-08-17-PM-03-30-25]
'
'     Version: 1.00.02
'     Last Updated: (2008 08 17 PM 03 28 20)
'     Version: 1.00.01
'     Last Updated: (2008 08 17 PM 02 32 13)
'
' -   -   -   -   -   -   -   -   -   -   -   -   -
' -   -   -   -   -   -   -   -   -   -   -   -   -

Public Class WJUsageCountHelperY2008M08
    Private m_FriendlyApplicationName As String = "[WJUsageCountHelperY2008M08]"

    Private m_ObjectIDAndUsageCount_StringDictionary As New System.Collections.Specialized.StringDictionary

    Public Function AddOneToUsageCountOfThisObject(ByVal ObjectID As String) As Integer
        ' (本段程式之目的) Purpose:
        '     Add one to usage count of this object.
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (重要等級) Importance rating:  80%
        ' (再利用的可能性) Chances of reuse:  80%
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2008 08 17 PM 01 52 32)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     OK
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        Dim UsageCount As Integer

        ' wjTeach:
        If Me.m_ObjectIDAndUsageCount_StringDictionary.ContainsKey(ObjectID) Then
            UsageCount = CType(Me.m_ObjectIDAndUsageCount_StringDictionary(ObjectID), Integer)
            UsageCount += 1

            Me.m_ObjectIDAndUsageCount_StringDictionary.Item(ObjectID) = UsageCount
        Else
            UsageCount = 1
            Me.m_ObjectIDAndUsageCount_StringDictionary.Add(ObjectID, UsageCount)
        End If

    End Function ' AddOneToUsageCountOfThisObject
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Function GenerateUsageCountReport() As String
        ' (本段程式之目的) Purpose:
        '     Generate usage count report.
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (重要等級) Importance rating:  80%
        ' (再利用的可能性) Chances of reuse:  80%
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2008 08 17 PM 02 03 01)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     OK
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        ' Begin_[2008_08_17_PM_02_39_12]
        ' Comments by WeiJin Tang (湯偉晉) :
        '   Reusable sample code
        '  
        Dim SB As New System.Text.StringBuilder
        Dim NumberOfObjects As Integer

        NumberOfObjects = Me.m_ObjectIDAndUsageCount_StringDictionary.Count
        Dim ObjectIDs(NumberOfObjects) As String
        Dim UsageCounts(NumberOfObjects) As String

        ' wjTeach:
        Me.m_ObjectIDAndUsageCount_StringDictionary.Values.CopyTo(UsageCounts, 0)
        Me.m_ObjectIDAndUsageCount_StringDictionary.Keys.CopyTo(ObjectIDs, 0)

        With SB
            .Append("Usage Count Report generated by " & Me.m_FriendlyApplicationName)
            .Append(vbCr)
            .Append("Number of objects I help = " & Me.m_ObjectIDAndUsageCount_StringDictionary.Count)
            .Append(vbCr)
            .Append(vbCr)
        End With

        For i As Integer = 0 To NumberOfObjects - 1
            With SB
                .Append("ObjectID = " & ObjectIDs.GetValue(i))
                .Append(vbTab)
                .Append("UsageCount = " & UsageCounts.GetValue(i))
                .Append(vbCr)
            End With
        Next

        ' Begin_[2008_08_17_PM_03_25_32]
        ' Comments by WeiJin Tang (湯偉晉) :
        '   Obsolete code
        '  
        'For i As Integer = NumberOfObjects - 1 To 0 Step -1
        '    With SB
        '        .Append("ObjectID = " & ObjectIDs.GetValue(i))
        '        .Append(vbTab)
        '        .Append("UsageCount = " & UsageCounts.GetValue(i))
        '        .Append(vbCr)
        '    End With
        'Next
        '  
        ' End_[2008_08_17_PM_03_25_32]

        Return SB.ToString
        '  
        ' End_[2008_08_17_PM_02_39_12]

    End Function ' GenerateUsageCountReport
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
End Class ' WJUsageCountHelperY2008M08

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_17_PM_03_30_56]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

2008年8月16日 星期六

2008年8月9日 星期六

Google_{Unable to upload unsupported file type} [2008-08-10]

Google_{Unable to upload unsupported file type} [2008-08-10]
 

WJAtTSINT2008.Tools_for_WJAtTSINT2008 [2008-08-10-MM-12-44-16]

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_10_MM_12_52_45]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
'     (友善的模組名稱) Friendly name of this module:
'           [WJAtTSINT2008].[Tools for WJAtTSINT2008]
'
'     (程式用模組名稱) Code name of this module:
'           WJAtTSINT2008.Tools_for_WJAtTSINT2008
'
'     WJAtTSINT2008.Tools_for_WJAtTSINT2008 [2008-08-10-MM-12-44-16]
'     Version: 1.00.02
'     Last Updated: (2008 08 10 PM 12 41 28)
'
'     Version: 1.00.01
'     Last Updated: (2008 04 03 PM 07 10 18)

Module Tools_for_WJAtTSINT2008
    Public Function GetStringInClipboard() As String
        ' (本段程式之目的) Purpose:
        '     Get the text content currently stored in system's clipboard.
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (重要等級) Importance rating:  85%
        ' (再利用的可能性) Chances of reuse:  90%
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2005 09 01 PM 01 50 25)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     OK
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        Dim myDataObject As System.Windows.Forms.IDataObject
        Dim T As String
        myDataObject = System.Windows.Forms.Clipboard.GetDataObject()

        ' Try to return Unicode Text first, if failed, then try to return ANSI Text
        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.UnicodeText) Then
            T = myDataObject.GetData(System.Windows.Forms.DataFormats.UnicodeText)
        Else
            If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Text) Then
                T = myDataObject.GetData(System.Windows.Forms.DataFormats.Text)
            Else
                T = String.Empty
            End If
        End If

        Return T

        ' Begin: Reusable code block (2005 09 01 PM 10 26 20)
        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Text) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Text]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Text]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.UnicodeText) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.UnicodeText]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.UnicodeText]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.WaveAudio) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.WaveAudio]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.WaveAudio]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Html) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Html]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Html]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Rtf) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Rtf]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Rtf]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Bitmap) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Bitmap]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Bitmap]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.PenData) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.PenData]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.PenData]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.StringFormat) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.StringFormat]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.StringFormat]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Serializable) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Serializable]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Serializable]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Riff) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Riff]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Riff]")
        End If
        ' End:    Reusable code block (2005 09 01 PM 10 26 20)

    End Function ' GetStringInClipboard
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Sub PasteStringToClipboard(ByVal AnyString As String)
        ' (本段程式之目的) Purpose:
        '     Paste string to Clipboard.
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (重要等級) Importance rating:  80%
        ' (再利用的可能性) Chances of reuse:  90%
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2004 12 06 PM 03 17 30)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     ok
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        Clipboard.SetDataObject(AnyString, True)

    End Sub ' PasteStringToClipboard
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Function GetStandardDateStamp_used_on_PDA() As String
        ' (本段程式之目的) Purpose:
        '     Return a time stamp like
        '               "2008-04-03"
        '     which is the default date stamp used on a PDA.
        '
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2008 04 03 PM 04 42 35)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     OK
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        Dim ThisMoment As Date
        ThisMoment = Now.Today

        Dim Y As String
        Dim M As String
        Dim D As String
        Y = ThisMoment.Year.ToString.PadLeft(4, "0"c)
        M = ThisMoment.Month.ToString.PadLeft(2, "0"c)
        D = ThisMoment.Day.ToString.PadLeft(2, "0"c)

        Return Y & "-" & M & "-" & D

    End Function ' GetStandardDateStamp_used_on_PDA
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Function 取得在PDA上使用的時間戳記() As String
        ' Chinese version of …
        Return GetStandardDateStamp_used_on_PDA()
    End Function ' 取得在PDA上使用的時間戳記
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Sub 把字串貼到剪貼簿上(ByVal 任何字串 As String)
        ' Chinese version of …
        PasteStringToClipboard(任何字串)
    End Sub ' 把字串貼到剪貼簿上
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Function 取得目前放在剪貼簿中的字串() As String
        ' Chinese version of …
        Return GetStringInClipboard()
    End Function
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
End Module ' Tools_for_WJAtTSINT2008

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_10_MM_12_52_45]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

Module Tools_for_WJAtTSINT2008 [2008-08-10]

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_10_MM_12_13_29]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
'     (友善的模組名稱) Friendly name of this module:
'           [WJAtTSINT2008].[Tools for WJAtTSINT2008]
'
'     (程式用模組名稱) Code name of this module:
'           WJAtTSINT2008.Tools_for_WJAtTSINT2008
'
'     Version: 1.00.01
'     Last Updated: (2008 04 03 PM 07 10 18)

Module Tools_for_WJAtTSINT2008
    Public Function GetStringInClipboard() As String
        ' (本段程式之目的) Purpose:
        '     Get the text content currently stored in system's clipboard.
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (重要等級) Importance rating:  85%
        ' (再利用的可能性) Chances of reuse:  90%
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2005 09 01 PM 01 50 25)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     OK
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        Dim myDataObject As System.Windows.Forms.IDataObject
        Dim T As String
        myDataObject = System.Windows.Forms.Clipboard.GetDataObject()

        ' Try to return Unicode Text first, if failed, then try to return ANSI Text
        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.UnicodeText) Then
            T = myDataObject.GetData(System.Windows.Forms.DataFormats.UnicodeText)
        Else
            If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Text) Then
                T = myDataObject.GetData(System.Windows.Forms.DataFormats.Text)
            Else
                T = String.Empty
            End If
        End If

        Return T

        ' Begin: Reusable code block (2005 09 01 PM 10 26 20)
        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Text) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Text]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Text]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.UnicodeText) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.UnicodeText]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.UnicodeText]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.WaveAudio) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.WaveAudio]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.WaveAudio]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Html) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Html]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Html]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Rtf) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Rtf]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Rtf]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Bitmap) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Bitmap]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Bitmap]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.PenData) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.PenData]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.PenData]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.StringFormat) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.StringFormat]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.StringFormat]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Serializable) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Serializable]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Serializable]")
        End If

        If myDataObject.GetDataPresent(System.Windows.Forms.DataFormats.Riff) Then
            MsgBox("Clipboard content is compatible with data type [System.Windows.Forms.DataFormats.Riff]")
        Else
            MsgBox("Clipboard content is    NOT      compatible with data type  [System.Windows.Forms.DataFormats.Riff]")
        End If
        ' End:    Reusable code block (2005 09 01 PM 10 26 20)

    End Function ' GetStringInClipboard
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Sub PasteStringToClipboard(ByVal AnyString As String)
        ' (本段程式之目的) Purpose:
        '     Paste string to Clipboard.
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (重要等級) Importance rating:  80%
        ' (再利用的可能性) Chances of reuse:  90%
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2004 12 06 PM 03 17 30)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     ok
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        Clipboard.SetDataObject(AnyString, True)

    End Sub ' PasteStringToClipboard
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    Public Function GetStandardDateStamp_used_on_PDA() As String
        ' (本段程式之目的) Purpose:
        '     Return a time stamp like
        '               "2008-04-03"
        '     which is the default date stamp used on a PDA.
        '
        ' (本段程式是否已經在被使用中) In use: Yes
        ' (程式撰寫的進度) Developing: 100% (Mandatory)
        ' (程式堪用的程度) Workable: 80% (Threshold at 80%)
        ' (程式的測試程度) Code tested: 80% (max 99%)
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ' (修改程式的日期) Revision Date: (2008 04 03 PM 04 42 35)
        ' (修改程式的人員) Revised by: WeiJin Tang (湯偉晉)
        '     OK
        ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        Dim ThisMoment As Date
        ThisMoment = Now.Today

        Dim Y As String
        Dim M As String
        Dim D As String
        Y = ThisMoment.Year.ToString.PadLeft(4, "0"c)
        M = ThisMoment.Month.ToString.PadLeft(2, "0"c)
        D = ThisMoment.Day.ToString.PadLeft(2, "0"c)

        Return Y & "-" & M & "-" & D

    End Function ' GetStandardDateStamp_used_on_PDA
    ' -   -   -   -   -   -   -   -   -   -   -   -   -
    ' -   -   -   -   -   -   -   -   -   -   -   -   -

End Module ' Tools_for_WJAtTSINT2008

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_10_MM_12_13_29]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

DemoCode_String_Split

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_09_PM_08_21_32]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
    Private Sub DemoCode_String_Split()
        ' [2008-08-09-PM-08-13-04]
        ' String.Split 方法
        ' 傳回 String 陣列,其中包含這個執行個體中由指定的 Char 或 String 陣列之
        ' 元素所分隔的子字串。
        '
        Dim S2 As String
        S2 = "ABC DEF GHI"

        Dim DelimitingString As String = " "

        Dim Ss() As String
        Ss = S2.Split(DelimitingString)

    End Sub ' DemoCode_String_Split

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' '  [2008_08_09_PM_08_21_32]  ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

2008年8月5日 星期二

Coding Homework [2008-08-06], designing class VersionInfoY2008M08D06

// - - Begin memo item - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //

(Memo Item created on August 6, 2008 11:10 AM)

- - - Begin title or keyword:

Coding Homework [2008-08-06], designing class VersionInfoY2008M08D06

- - - End title or keyword:

 

Description of this homework:

Design a class to automatically update a "Version Info String" like the following ones:

 

For using in other environments, like Microsoft Word:

Version: 1.00.01; Last Updated: [2008-08-06-AM-10-49-50]

Version: 1.00.01; Last Updated: [2008-08-06]

 

For using in a code editor, like VB's code editor:

Version: 1.00.01; Last Updated: [2008_08_06_AM_10_49_50]

Version: 1.00.01; Last Updated: [2008_08_06]

 

For saving some inks while printing it to a printer:

Version: 1.00.01; Last Updated: [2008 08 06 AM 10 49 50]

Version: 1.00.01; Last Updated: [2008 08 06]

 

We need to update the first "Version Info String" by inserting a newly updated "Version Info String" in a new paragraph right before it.

 

Input:

Text with one or more "Version Info String" embedded in it.

 

Output:

Text with a newly updated "Version Info String" inserted right before the first last updated "Version Info String".

 

Name of this class:

VersionInfoY2008M08D06

 

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - End memo item - - //

 

2008年8月2日 星期六

如何在表單載入時顯示程式的版本編號 (Code to display the version info of your program)

 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' 如何在表單載入時顯示程式的版本編號
        ' Code to display the version info of your program
        '
        Me.Text = Me.Text & " - " & Application.ProductVersion
    End Sub ' Form1_Load