
'*************************************************************************
'
'      Author       : Esben Laursen (hyber@hyber.dk)
'      
'      Webpage      : http://www.hyber.dk or http://netsmsgw.sf.net
'
'      Notes        :
'
'      License      : This program is free software; you can redistribute
'                     it and/or modify it under the terms of the GNU
'                     General Public License as published by the Free
'                     Software Foundation version 2 of the License.
'
'*************************************************************************

<Serializable()> _
Public Class smsMsg

    Public ID As String
    Public Number As String = ""
    Public Message As String = ""
    Public Priority As smsUtils.smsPriority = smsUtils.smsPriority.Normal
    Public MessagePrefix As String = ""
    Public MessageSuffix As String = ""

    Public Sub New()

        ID = RandomString(100)

    End Sub

    Private Function RandomString(ByVal pintLength As Integer) As String
        Dim builder As New System.Text.StringBuilder
        Dim r As New Random()
        Dim ch As Char
        Dim i As Integer
        Dim i2 As Integer


        For i = 0 To pintLength - 1
            i2 = r.Next(45, 125)
            Select Case Char.IsLetterOrDigit(Convert.ToChar(i2))
                Case True
                    ch = Convert.ToChar(i2)
                    builder.Append(ch)
                Case False
                    i -= 1
            End Select
        Next
        Return builder.ToString()
    End Function


End Class
