庆祝!发表在CodeProject上的文章被评为Prize winner: June, 2005

今天收到一封来自CodeProject上的邮件,说是中奖了,一看,真的是哦。中奖的文章文章是:
Using VB.NET to Encode SMS and EMS

也就是我写的SMS和EMS的编码器。以下是邮件:

Hi hesicong,

Congratulations! You have won the CodeProject article competition for June.

Category : VB.NET
Article : Using VB.NET to Encode SMS and EMS
Location : http://www.codeproject.com/vb/net/PDUEncoder.asp

Prizes :

Spread Server 2.0 from SoftWidgets. Value: $1,500
http://softwidgets.com/products/reporting.aspx?adid=JYM-37282

Spell Code from SoftWidgets. Value: $20
http://softwidgets.com/products/spellcode.aspx?adid=XIC-90661

In total you have won $1,520 in prizes.

The companies donating the prizes have been notified and will be in contact you soon.

Again - thanks for your contribution to the CodeProject community.

Chris Maunder
http://www.codeproject.com

后来看了看CodeProject上的说明说是有可能要自行交税。才是晕哦,我可不想交税,交的话退回去算了,对我来说这两个软件用处不大。更看中的是荣誉,这是对我劳动的肯定。

更要加油了,还有很多的路要走,一路走好!

AT相关正则表达式

. 取得AT指令及参数
AT+(?w)=(?:”?(?w+)”?,?)

. 取得返回的包含+CMD类型的
+(?w):s(?:”?(?w),|(?w+)”?)

. AT+CMGL返回
^+CMGL:s(?d),(?d),(?d),(?d)rns(?w*)

轻轻松松背单词II 词库转换器(源代码)

原理很简单,看看就懂:)

Imports System.IO
Imports System.Text
Module BDCWordConverter
Sub main()
Dim dir As New DirectoryInfo("D:bdcWord")
Dim fi As FileInfo() = dir.GetFiles("*.gds")
For Each f As FileInfo In fi
Dim fs As New FileStream(f.FullName, FileMode.Open)
Dim br As New BinaryReader(fs)
fs.Position = 12
Dim b01 As Byte() = br.ReadBytes(20)
ReDim Preserve b01(27)
br.BaseStream.Position = 50
Dim b02 As Byte() = br.ReadBytes(8)
b02.CopyTo(b01, 20)
Console.WriteLine(f.FullName)
Dim fileName As String = New StringBuilder(Encoding.GetEncoding("GB2312").GetChars(b01)).ToString.TrimEnd(CChar(" "))
Console.WriteLine("Processing {0}", fileName)
Dim fw As New StreamWriter("D:bdc word" & fileName.TrimEnd(Chr(0)) & ".txt")
Dim startPos As Integer = 290
Dim offWord As Integer = 30
Dim offPun As Integer = 30
Dim offMean As Integer = 40
Dim offCourse As Integer = 28
br.BaseStream.Position = 290
Dim Word As String
Dim Pun As String
Dim Mean As String
Do Until br.PeekChar = -1
Dim b1 As Byte() = br.ReadBytes(offWord)
Word = New ASCIIEncoding().GetChars(b1)
Dim b2 As Byte() = br.ReadBytes(offPun)
Pun = New ASCIIEncoding().GetChars(b2)
Dim b3 As Byte() = br.ReadBytes(offMean)
Mean = New StringBuilder(Encoding.GetEncoding("GB2312").GetChars(b3)).ToString
br.ReadBytes(offCourse)
fw.WriteLine("""{0}"",""{1}"",""{2}""", Word.TrimEnd(CChar(" ")), Pun.TrimEnd(CChar(" ")), Mean.TrimEnd(CChar(" ")))
Loop
fs.Flush()
fs.Close()
Next
End Sub

End Module

.net平台下PDA红外连接手机通讯

今天终于弄明白了PDA红外如何控制手机通讯了。

其实简单,就是PDA的红外模拟的串口和手机通讯。

  • 如何取得PDA红外模拟的串口号呢?以我的HP1937为例,我用注册表编辑器浏览[HKEY_LOCAL_MACHINEDriversBuiltInIRDA2410]可以找到Port,我这里是COM3。串口就找到了。
  • PDA上的串口通讯。OpenNetCF里面有很强大的类库,其IO.Serial就是一个很好用的串口类,有VB.NET和C#的例程:[HKEY_LOCAL_MACHINEDriversBuiltInIRDA2410]
  • 熟悉AT指令,熟悉PDU编码……一切都搞定了…………

有空就开始做一个PDA上发短信的玩意儿,手机按起来太慢了:)

VB.NET里最方便的XP风格解决方案

将以下代码添加到InitializeComponent()之后

On Error Resume Next
Dim y As Integer
Dim AppName As String
Dim ManFileName As String
Dim FullAppExeNameAndPath As String
FullAppExeNameAndPath = Application.ExecutablePath
y = Application.StartupPath.Length
' y = FullAppExeNameAndPath.LastIndexOf("")
y = y + 1
AppName = FullAppExeNameAndPath.Substring(y, FullAppExeNameAndPath.Length - y)
ManFileName = AppName & ".manifest"

If System.IO.File.Exists(ManFileName) = False Then
FileOpen(1, ManFileName, OpenMode.Binary)
FilePut(1, "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" & Environment.NewLine)
FilePut(1, "<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>" & Environment.NewLine)
FilePut(1, "<assemblyIdentity version='1.0.0.0' processorArchitecture='X86' name='zx.exe' type='win32' />" & Environment.NewLine)
FilePut(1, "<description>zxapplication</description>" & Environment.NewLine)
FilePut(1, "<dependency>" & Environment.NewLine)
FilePut(1, "<dependentAssembly>" & Environment.NewLine)
FilePut(1, "<assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*' />" & Environment.NewLine)
FilePut(1, "</dependentAssembly>" & Environment.NewLine)
FilePut(1, "</dependency>" & Environment.NewLine)
FilePut(1, "</assembly>" & Environment.NewLine)
FileClose(1)
End If