God is love
darkdee
read my profile
sign my guestbook

Visit darkdee's Xanga Site!

Name: ?
Gender: Male


Message: message me


Member Since: 11/2/2005

SubscriptionsSites I Read

Blogrings
UNground UNwear UNion
previous - random - next

~SSPTTM~*
previous - random - next

CityU AscISD 2006
previous - random - next

*~!CityUCSS~|黃帝蕉|~O'camp08!~*
previous - random - next

黃長蕉 @ CityU CSS 08 O Camp
previous - random - next

CityU CSS 08 O Camp
previous - random - next


Posting Calendar

|<< oldest | newest >>|
view all weblog archives

Get Involved!

Suggest a link

Recommend to friend

Create a site


Wednesday, November 04, 2009

新blog

http://darkdee-shek.blogspot.com/


Monday, October 26, 2009

突然害怕了...
宊然疲倦了...


Wednesday, October 21, 2009

Get result from cmd VB.net

Public Function Cmd(ByVal Command As String) As String
        Dim process As New System.Diagnostics.Process()
        process.StartInfo.FileName = "cmd.exe"
        process.StartInfo.UseShellExecute = False
        process.StartInfo.RedirectStandardInput = True
        process.StartInfo.RedirectStandardOutput = True
        process.StartInfo.RedirectStandardError = True
        process.StartInfo.CreateNoWindow = True
        process.Start()
        process.StandardInput.WriteLine(Command)
        process.StandardInput.WriteLine("exit")
        Dim Result As String = process.StandardOutput.ReadToEnd()
        process.Close()
        Return Result
End Function


usage:

Dim result As String

result = Cmd("ipconfig")

Debug.Print(result)


 Reference: http://blog.xuite.net/jeremy5189/vbdisplay/22967489


Monday, October 19, 2009

將Gmail的email轉寄到另一個email acc

首先登左你個Account先, 之後揀右上角的設定, 如下圖


之後選"轉寄和POP/IMAP"
再揀埋"轉寄外來郵件的副本給...", 在白色的地方打返你想轉寄去的電郵地址
最後按"儲存變更", 就可以了



Friday, October 16, 2009

Add/Remove SQLite table column in VB.net

Remove Column is a bit complicated because SQLite do not support remove Column =.=
So what I am going to do is
1. backup a table
2. create a new table
3. insert data into new table by backup table

Public Sub executeNonQuery(ByVal sql As String)
While busy
End While

busy = True

Try
SQLcommand = SQLconnect.CreateCommand
SQLcommand.CommandText = sql
SQLcommand.ExecuteNonQuery()
SQLcommand.Dispose()
Catch ex As Exception
End Try

busy = False
End Sub

Private Function getAllColumnName(ByVal tableName As String)
Dim sql As String = "SELECT * From " + tableName + " WHERE page = 1;"
SQLcommand = SQLconnect.CreateCommand
SQLcommand.CommandText = sql
Dim columnNames As String = ""
Try
Dim sqlDataReader As SQLite.SQLiteDataReader = SQLcommand.ExecuteReader()

For i As Integer = 0 To sqlDataReader.VisibleFieldCount - 1
If i = sqlDataReader.VisibleFieldCount - 1 Then
columnNames += sqlDataReader.GetName(i)
Else
columnNames += sqlDataReader.GetName(i) + ", "
End If
Next
Catch ex As Exception
End Try

Return columnNames
End Function

Public Sub removeColumn(ByVal tableName As String, ByVal columnName As String)
Dim columnNames As String = getAllColumnName(tableName)
columnNames = columnNames.Replace(columnName + ", ", "")
columnNames = columnNames.Replace(", " + columnName, "")
columnNames = columnNames.Replace(columnName, "")
executeNonQuery("CREATE TEMPORARY TABLE " + tableName + "backup(" + columnNames + ");")
executeNonQuery("INSERT INTO " + tableName + "backup SELECT " + columnNames + " FROM " + tableName + ";")
executeNonQuery("DROP TABLE " + tableName + ";")
executeNonQuery("CREATE TABLE " + tableName + "(" + columnNames + ");")
executeNonQuery("INSERT INTO " + tableName + " SELECT " + columnNames + " FROM " + tableName + "backup;")
executeNonQuery("DROP TABLE " + tableName + "backup;")
End Sub

Add a column is much more easy
Public Sub addColumn(ByVal tableName As String, ByVal columnName As String, ByVal columnType As String)
executeNonQuery("ALTER TABLE " + tableName + " ADD COLUMN " + columnName + " " + columnType + ";")
End Sub



Next 5 >>