Thursday, April 5, 2007

Monthly Report - March 2007

返工 每月報告

Period: 1 March 2007 - 31 March 2007

Task Performed

1. CMS Website using Dotnetnuke (ASP.NET in VBScript)

 



成個月"忙到爆廠"啦, 好大壓力, 不過越來越肥 ...

 

終於起好個Dotnetnuke網站 (仲未起個 testing, 要俾佢地按一個掣 export 啲 content, 之後 import 番去 live site)

非常後悔買左個 Registration module. 而家個layout 都幾樣衰, 因為係用 javascript 强行移位, 希望過到骨啦... (如果聽老細話, 一早自己寫module就好了)

Dotnetnuke 有得 set schedule, 行個自己寫的dll, 唔知佢背後係點做呢? 寫左一個dll用來 send registration email, 一個用來 synchronize 啲 account 去個客另一個 salesforce CRM 網站 (php interface有人寫)

下面用 post 放式造訪網站的source code

Private Function queryUrl(ByVal url As String, ByVal params As String, ByVal message As String) As Boolean
            Dim result As String = ""
            Dim strPost As String = params
            Dim textEncoding As New System.Text.UTF8Encoding
            Dim strPostBytes As Byte() = textEncoding.GetBytes(strPost)
            Dim myWriter As System.IO.StreamWriter = Nothing
            Dim myReader As System.IO.StreamReader = Nothing
            Dim content As String

            Me.ScheduleHistoryItem.AddLogNote(url)

            Dim objRequest As Net.HttpWebRequest = CType(System.Net.WebRequest.Create(url), Net.HttpWebRequest)
            objRequest.Method = "POST"
            objRequest.ContentLength = strPostBytes.Length
            objRequest.ContentType = "application/x-www-form-urlencoded"

            Try
                Me.ScheduleHistoryItem.AddLogNote(strPost)
                myWriter = New System.IO.StreamWriter(objRequest.GetRequestStream())
                myWriter.Write(strPost)

                myWriter.Flush()

                'Get response
                Dim myResponse As Net.HttpWebResponse = CType(objRequest.GetResponse(), Net.HttpWebResponse)
                myReader = New StreamReader(myResponse.GetResponseStream(), Encoding.Default)
                content = myReader.ReadToEnd()

                Me.ScheduleHistoryItem.AddLogNote("posted")
            Catch ex As Exception
                Return False
            Finally
                myReader.Close()
                myWriter.Close()
            End Try
            If content.Equals(message) Then
                Return True
            Else
                Return False
            End If
        End Function

queryUrl("http://www.google.com","username=xxx&lastname=yyy","success")

個 project 令我學識左 vb 的asp.net, 同 Dotnetnuke. 但係對住幾個月, content management, 個site又慢, 好悶...

 


 

而家開始寫個 "鬥地主" 賭 site (唔知點解突然多人玩) , 負責個 java socket server, flash game 由其他人(一個人)寫.

之前個"百家樂"的 source 俾左我, 所有 connection 部份都寫好左, 只係改啲 game logic, 同加個 game lobby.

如果java要 through connection send 啲 utf8 出去的話, 要用byte方式, 否則flash會收爛字

private void sendMessage(String msg) {
       try
       {
       byte bytes[] = msg.getBytes("UTF-8");
       out.write(bytes,0,bytes.length);
       }catch(Exception e)
       {
           System.out.println(e.getMessage());
       }
       out.write(0);
   }

No comments: