2015年3月9日 星期一

依檔案的建立日期刪除檔案


 Dim delday As Date = "2015/2/1"
        TextBox1.Text = ""
        For Each fname As String In System.IO.Directory.GetFileSystemEntries("d:\csv_backup", "*.txt")
            If FileDateTime(fname) < delday Then
                TextBox1.AppendText(fname & "  *" & vbCrLf)
                kill ( fname)
            Else
                TextBox1.AppendText(fname & vbCrLf)
            End If
        Next

2015年2月16日 星期一

單眼的基本入門圖

單眼的基本入門圖
這一張圖看得懂,就差不多掌握了基本的竅門

2015年1月30日 星期五

mssql 取區間號碼

參考來源
---
select id1,(select min(id)-1 from table where id > id1) as id2 from (
select id+1 as id1 from table where id+1 not in (select id from table) and id < (select max(id) from table)
) as t1

還真好用!! 取區間號碼

2014年12月11日 星期四

VBNET 自然憑證簡易驗證


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a As String = "AB01234567891234"
        MessageBox.Show(chk_card(a))
    End Sub

    Public Overloads Function chk_card(ByVal card_code As String) As Boolean
        Dim chk_yn As Boolean = False
        Try
            Dim str_g As String = ""
            Dim y As Integer = 0
            For i As Integer = 1 To 16
                str_g = Mid(card_code, i, 1)
                Select Case i
                    Case 1 To 2
                        If Asc(str_g) > 90 Or Asc(str_g) < 65 Then
                            y = 1
                            Exit For
                        End If
                    Case 3 To 16
                        If Asc(str_g) > 57 Or Asc(str_g) < 48 Then
                            y = 1
                            Exit For
                        End If
                End Select
            Next
            If y = 0 Then
                chk_yn = True
            End If
            Return chk_yn
        Catch ex As Exception
            Return chk_yn
        End Try
    End Function