mirror of
https://github.com/jakobadam/RDSFactor.git
synced 2025-06-09 05:54:44 +02:00
Rename: Console -> RDSFactorConfig
This commit is contained in:
parent
7bd3ec25e1
commit
09ba4750ad
54 changed files with 3834 additions and 4418 deletions
|
@ -1,20 +0,0 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
|
||||||
# Visual Studio 2010
|
|
||||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CICRadarRConfig", "CICRadarRConfig\CICRadarRConfig.vbproj", "{698299A4-5778-4EE0-9C46-445A9B66F645}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|x86.Build.0 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
Binary file not shown.
|
@ -1,344 +0,0 @@
|
||||||
Imports System
|
|
||||||
Imports System.IO
|
|
||||||
Imports System.Security.Cryptography
|
|
||||||
|
|
||||||
'
|
|
||||||
' encrypt/decrypt functions
|
|
||||||
' Parameter checks and error handling
|
|
||||||
' are ommited for better readability
|
|
||||||
'
|
|
||||||
|
|
||||||
Public Class EncDec
|
|
||||||
' Encrypt a byte array into a byte array using a key and an IV
|
|
||||||
Public Shared Function Encrypt(ByVal clearData As Byte(), ByVal Key As Byte(), ByVal IV As Byte()) As Byte()
|
|
||||||
' Create a MemoryStream to accept the encrypted bytes
|
|
||||||
Dim ms As New MemoryStream()
|
|
||||||
|
|
||||||
' Create a symmetric algorithm.
|
|
||||||
' We are going to use Rijndael because it is strong and
|
|
||||||
' available on all platforms.
|
|
||||||
' You can use other algorithms, to do so substitute the
|
|
||||||
' next line with something like
|
|
||||||
' TripleDES alg = TripleDES.Create();
|
|
||||||
Dim alg As Rijndael = Rijndael.Create()
|
|
||||||
|
|
||||||
' Now set the key and the IV.
|
|
||||||
' We need the IV (Initialization Vector) because
|
|
||||||
' the algorithm is operating in its default
|
|
||||||
' mode called CBC (Cipher Block Chaining).
|
|
||||||
' The IV is XORed with the first block (8 byte)
|
|
||||||
' of the data before it is encrypted, and then each
|
|
||||||
' encrypted block is XORed with the
|
|
||||||
' following block of plaintext.
|
|
||||||
' This is done to make encryption more secure.
|
|
||||||
|
|
||||||
' There is also a mode called ECB which does not need an IV,
|
|
||||||
' but it is much less secure.
|
|
||||||
alg.Key = Key
|
|
||||||
alg.IV = IV
|
|
||||||
|
|
||||||
' Create a CryptoStream through which we are going to be
|
|
||||||
' pumping our data.
|
|
||||||
' CryptoStreamMode.Write means that we are going to be
|
|
||||||
' writing data to the stream and the output will be written
|
|
||||||
' in the MemoryStream we have provided.
|
|
||||||
Dim cs As New CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write)
|
|
||||||
|
|
||||||
' Write the data and make it do the encryption
|
|
||||||
cs.Write(clearData, 0, clearData.Length)
|
|
||||||
|
|
||||||
' Close the crypto stream (or do FlushFinalBlock).
|
|
||||||
' This will tell it that we have done our encryption and
|
|
||||||
' there is no more data coming in,
|
|
||||||
' and it is now a good time to apply the padding and
|
|
||||||
' finalize the encryption process.
|
|
||||||
cs.Close()
|
|
||||||
|
|
||||||
' Now get the encrypted data from the MemoryStream.
|
|
||||||
' Some people make a mistake of using GetBuffer() here,
|
|
||||||
' which is not the right way.
|
|
||||||
Dim encryptedData As Byte() = ms.ToArray()
|
|
||||||
|
|
||||||
Return encryptedData
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Encrypt a string into a string using a password
|
|
||||||
' Uses Encrypt(byte[], byte[], byte[])
|
|
||||||
|
|
||||||
Public Shared Function Encrypt(ByVal clearText As String, ByVal Password As String) As String
|
|
||||||
' First we need to turn the input string into a byte array.
|
|
||||||
Dim clearBytes As Byte() = System.Text.Encoding.Unicode.GetBytes(clearText)
|
|
||||||
|
|
||||||
' Then, we need to turn the password into Key and IV
|
|
||||||
' We are using salt to make it harder to guess our key
|
|
||||||
' using a dictionary attack -
|
|
||||||
' trying to guess a password by enumerating all possible words.
|
|
||||||
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, _
|
|
||||||
&H65, &H64, &H76, &H65, &H64, &H65, _
|
|
||||||
&H76})
|
|
||||||
|
|
||||||
' Now get the key/IV and do the encryption using the
|
|
||||||
' function that accepts byte arrays.
|
|
||||||
' Using PasswordDeriveBytes object we are first getting
|
|
||||||
' 32 bytes for the Key
|
|
||||||
' (the default Rijndael key length is 256bit = 32bytes)
|
|
||||||
' and then 16 bytes for the IV.
|
|
||||||
' IV should always be the block size, which is by default
|
|
||||||
' 16 bytes (128 bit) for Rijndael.
|
|
||||||
' If you are using DES/TripleDES/RC2 the block size is
|
|
||||||
' 8 bytes and so should be the IV size.
|
|
||||||
' You can also read KeySize/BlockSize properties off
|
|
||||||
' the algorithm to find out the sizes.
|
|
||||||
Dim encryptedData As Byte() = Encrypt(clearBytes, pdb.GetBytes(32), pdb.GetBytes(16))
|
|
||||||
|
|
||||||
' Now we need to turn the resulting byte array into a string.
|
|
||||||
' A common mistake would be to use an Encoding class for that.
|
|
||||||
'It does not work because not all byte values can be
|
|
||||||
' represented by characters.
|
|
||||||
' We are going to be using Base64 encoding that is designed
|
|
||||||
'exactly for what we are trying to do.
|
|
||||||
Return Convert.ToBase64String(encryptedData)
|
|
||||||
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Encrypt bytes into bytes using a password
|
|
||||||
' Uses Encrypt(byte[], byte[], byte[])
|
|
||||||
|
|
||||||
Public Shared Function Encrypt(ByVal clearData As Byte(), ByVal Password As String) As Byte()
|
|
||||||
' We need to turn the password into Key and IV.
|
|
||||||
' We are using salt to make it harder to guess our key
|
|
||||||
' using a dictionary attack -
|
|
||||||
' trying to guess a password by enumerating all possible words.
|
|
||||||
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, _
|
|
||||||
&H65, &H64, &H76, &H65, &H64, &H65, _
|
|
||||||
&H76})
|
|
||||||
|
|
||||||
' Now get the key/IV and do the encryption using the function
|
|
||||||
' that accepts byte arrays.
|
|
||||||
' Using PasswordDeriveBytes object we are first getting
|
|
||||||
' 32 bytes for the Key
|
|
||||||
' (the default Rijndael key length is 256bit = 32bytes)
|
|
||||||
' and then 16 bytes for the IV.
|
|
||||||
' IV should always be the block size, which is by default
|
|
||||||
' 16 bytes (128 bit) for Rijndael.
|
|
||||||
' If you are using DES/TripleDES/RC2 the block size is 8
|
|
||||||
' bytes and so should be the IV size.
|
|
||||||
' You can also read KeySize/BlockSize properties off the
|
|
||||||
' algorithm to find out the sizes.
|
|
||||||
Return Encrypt(clearData, pdb.GetBytes(32), pdb.GetBytes(16))
|
|
||||||
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Encrypt a file into another file using a password
|
|
||||||
Public Shared Sub Encrypt(ByVal fileIn As String, ByVal fileOut As String, ByVal Password As String)
|
|
||||||
|
|
||||||
' First we are going to open the file streams
|
|
||||||
Dim fsIn As New FileStream(fileIn, FileMode.Open, FileAccess.Read)
|
|
||||||
Dim fsOut As New FileStream(fileOut, FileMode.OpenOrCreate, FileAccess.Write)
|
|
||||||
|
|
||||||
' Then we are going to derive a Key and an IV from the
|
|
||||||
' Password and create an algorithm
|
|
||||||
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, _
|
|
||||||
&H65, &H64, &H76, &H65, &H64, &H65, _
|
|
||||||
&H76})
|
|
||||||
|
|
||||||
Dim alg As Rijndael = Rijndael.Create()
|
|
||||||
alg.Key = pdb.GetBytes(32)
|
|
||||||
alg.IV = pdb.GetBytes(16)
|
|
||||||
|
|
||||||
' Now create a crypto stream through which we are going
|
|
||||||
' to be pumping data.
|
|
||||||
' Our fileOut is going to be receiving the encrypted bytes.
|
|
||||||
Dim cs As New CryptoStream(fsOut, alg.CreateEncryptor(), CryptoStreamMode.Write)
|
|
||||||
|
|
||||||
' Now will will initialize a buffer and will be processing
|
|
||||||
' the input file in chunks.
|
|
||||||
' This is done to avoid reading the whole file (which can
|
|
||||||
' be huge) into memory.
|
|
||||||
Dim bufferLen As Integer = 4096
|
|
||||||
Dim buffer As Byte() = New Byte(bufferLen - 1) {}
|
|
||||||
Dim bytesRead As Integer
|
|
||||||
|
|
||||||
Do
|
|
||||||
' read a chunk of data from the input file
|
|
||||||
bytesRead = fsIn.Read(buffer, 0, bufferLen)
|
|
||||||
|
|
||||||
' encrypt it
|
|
||||||
cs.Write(buffer, 0, bytesRead)
|
|
||||||
Loop While bytesRead <> 0
|
|
||||||
|
|
||||||
' close everything
|
|
||||||
|
|
||||||
' this will also close the unrelying fsOut stream
|
|
||||||
cs.Close()
|
|
||||||
fsIn.Close()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Decrypt a byte array into a byte array using a key and an IV
|
|
||||||
Public Shared Function Decrypt(ByVal cipherData As Byte(), ByVal Key As Byte(), ByVal IV As Byte()) As Byte()
|
|
||||||
' Create a MemoryStream that is going to accept the
|
|
||||||
' decrypted bytes
|
|
||||||
Dim ms As New MemoryStream()
|
|
||||||
|
|
||||||
' Create a symmetric algorithm.
|
|
||||||
' We are going to use Rijndael because it is strong and
|
|
||||||
' available on all platforms.
|
|
||||||
' You can use other algorithms, to do so substitute the next
|
|
||||||
' line with something like
|
|
||||||
' TripleDES alg = TripleDES.Create();
|
|
||||||
Dim alg As Rijndael = Rijndael.Create()
|
|
||||||
|
|
||||||
' Now set the key and the IV.
|
|
||||||
' We need the IV (Initialization Vector) because the algorithm
|
|
||||||
' is operating in its default
|
|
||||||
' mode called CBC (Cipher Block Chaining). The IV is XORed with
|
|
||||||
' the first block (8 byte)
|
|
||||||
' of the data after it is decrypted, and then each decrypted
|
|
||||||
' block is XORed with the previous
|
|
||||||
' cipher block. This is done to make encryption more secure.
|
|
||||||
' There is also a mode called ECB which does not need an IV,
|
|
||||||
' but it is much less secure.
|
|
||||||
alg.Key = Key
|
|
||||||
alg.IV = IV
|
|
||||||
|
|
||||||
' Create a CryptoStream through which we are going to be
|
|
||||||
' pumping our data.
|
|
||||||
' CryptoStreamMode.Write means that we are going to be
|
|
||||||
' writing data to the stream
|
|
||||||
' and the output will be written in the MemoryStream
|
|
||||||
' we have provided.
|
|
||||||
Dim cs As New CryptoStream(ms, alg.CreateDecryptor(), CryptoStreamMode.Write)
|
|
||||||
|
|
||||||
' Write the data and make it do the decryption
|
|
||||||
cs.Write(cipherData, 0, cipherData.Length)
|
|
||||||
|
|
||||||
' Close the crypto stream (or do FlushFinalBlock).
|
|
||||||
' This will tell it that we have done our decryption
|
|
||||||
' and there is no more data coming in,
|
|
||||||
' and it is now a good time to remove the padding
|
|
||||||
' and finalize the decryption process.
|
|
||||||
cs.Close()
|
|
||||||
|
|
||||||
' Now get the decrypted data from the MemoryStream.
|
|
||||||
' Some people make a mistake of using GetBuffer() here,
|
|
||||||
' which is not the right way.
|
|
||||||
Dim decryptedData As Byte() = ms.ToArray()
|
|
||||||
|
|
||||||
Return decryptedData
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Decrypt a string into a string using a password
|
|
||||||
' Uses Decrypt(byte[], byte[], byte[])
|
|
||||||
|
|
||||||
Public Shared Function Decrypt(ByVal cipherText As String, ByVal Password As String) As String
|
|
||||||
' First we need to turn the input string into a byte array.
|
|
||||||
' We presume that Base64 encoding was used
|
|
||||||
Dim cipherBytes As Byte() = Convert.FromBase64String(cipherText)
|
|
||||||
|
|
||||||
' Then, we need to turn the password into Key and IV
|
|
||||||
' We are using salt to make it harder to guess our key
|
|
||||||
' using a dictionary attack -
|
|
||||||
' trying to guess a password by enumerating all possible words.
|
|
||||||
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, _
|
|
||||||
&H65, &H64, &H76, &H65, &H64, &H65, _
|
|
||||||
&H76})
|
|
||||||
|
|
||||||
' Now get the key/IV and do the decryption using
|
|
||||||
' the function that accepts byte arrays.
|
|
||||||
' Using PasswordDeriveBytes object we are first
|
|
||||||
' getting 32 bytes for the Key
|
|
||||||
' (the default Rijndael key length is 256bit = 32bytes)
|
|
||||||
' and then 16 bytes for the IV.
|
|
||||||
' IV should always be the block size, which is by
|
|
||||||
' default 16 bytes (128 bit) for Rijndael.
|
|
||||||
' If you are using DES/TripleDES/RC2 the block size is
|
|
||||||
' 8 bytes and so should be the IV size.
|
|
||||||
' You can also read KeySize/BlockSize properties off
|
|
||||||
' the algorithm to find out the sizes.
|
|
||||||
Dim decryptedData As Byte() = Decrypt(cipherBytes, pdb.GetBytes(32), pdb.GetBytes(16))
|
|
||||||
|
|
||||||
' Now we need to turn the resulting byte array into a string.
|
|
||||||
' A common mistake would be to use an Encoding class for that.
|
|
||||||
' It does not work
|
|
||||||
' because not all byte values can be represented by characters.
|
|
||||||
' We are going to be using Base64 encoding that is
|
|
||||||
' designed exactly for what we are trying to do.
|
|
||||||
Return System.Text.Encoding.Unicode.GetString(decryptedData)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Decrypt bytes into bytes using a password
|
|
||||||
' Uses Decrypt(byte[], byte[], byte[])
|
|
||||||
|
|
||||||
Public Shared Function Decrypt(ByVal cipherData As Byte(), ByVal Password As String) As Byte()
|
|
||||||
' We need to turn the password into Key and IV.
|
|
||||||
' We are using salt to make it harder to guess our key
|
|
||||||
' using a dictionary attack -
|
|
||||||
' trying to guess a password by enumerating all possible words.
|
|
||||||
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, _
|
|
||||||
&H65, &H64, &H76, &H65, &H64, &H65, _
|
|
||||||
&H76})
|
|
||||||
|
|
||||||
' Now get the key/IV and do the Decryption using the
|
|
||||||
'function that accepts byte arrays.
|
|
||||||
' Using PasswordDeriveBytes object we are first getting
|
|
||||||
' 32 bytes for the Key
|
|
||||||
' (the default Rijndael key length is 256bit = 32bytes)
|
|
||||||
' and then 16 bytes for the IV.
|
|
||||||
' IV should always be the block size, which is by default
|
|
||||||
' 16 bytes (128 bit) for Rijndael.
|
|
||||||
' If you are using DES/TripleDES/RC2 the block size is
|
|
||||||
' 8 bytes and so should be the IV size.
|
|
||||||
|
|
||||||
' You can also read KeySize/BlockSize properties off the
|
|
||||||
' algorithm to find out the sizes.
|
|
||||||
Return Decrypt(cipherData, pdb.GetBytes(32), pdb.GetBytes(16))
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Decrypt a file into another file using a password
|
|
||||||
Public Shared Sub Decrypt(ByVal fileIn As String, ByVal fileOut As String, ByVal Password As String)
|
|
||||||
|
|
||||||
' First we are going to open the file streams
|
|
||||||
Dim fsIn As New FileStream(fileIn, FileMode.Open, FileAccess.Read)
|
|
||||||
Dim fsOut As New FileStream(fileOut, FileMode.OpenOrCreate, FileAccess.Write)
|
|
||||||
|
|
||||||
' Then we are going to derive a Key and an IV from
|
|
||||||
' the Password and create an algorithm
|
|
||||||
Dim pdb As New PasswordDeriveBytes(Password, New Byte() {&H49, &H76, &H61, &H6E, &H20, &H4D, _
|
|
||||||
&H65, &H64, &H76, &H65, &H64, &H65, _
|
|
||||||
&H76})
|
|
||||||
Dim alg As Rijndael = Rijndael.Create()
|
|
||||||
|
|
||||||
alg.Key = pdb.GetBytes(32)
|
|
||||||
alg.IV = pdb.GetBytes(16)
|
|
||||||
|
|
||||||
' Now create a crypto stream through which we are going
|
|
||||||
' to be pumping data.
|
|
||||||
' Our fileOut is going to be receiving the Decrypted bytes.
|
|
||||||
Dim cs As New CryptoStream(fsOut, alg.CreateDecryptor(), CryptoStreamMode.Write)
|
|
||||||
|
|
||||||
' Now will will initialize a buffer and will be
|
|
||||||
' processing the input file in chunks.
|
|
||||||
' This is done to avoid reading the whole file (which can be
|
|
||||||
' huge) into memory.
|
|
||||||
Dim bufferLen As Integer = 4096
|
|
||||||
Dim buffer As Byte() = New Byte(bufferLen - 1) {}
|
|
||||||
Dim bytesRead As Integer
|
|
||||||
|
|
||||||
Do
|
|
||||||
' read a chunk of data from the input file
|
|
||||||
bytesRead = fsIn.Read(buffer, 0, bufferLen)
|
|
||||||
|
|
||||||
' Decrypt it
|
|
||||||
|
|
||||||
cs.Write(buffer, 0, bytesRead)
|
|
||||||
Loop While bytesRead <> 0
|
|
||||||
|
|
||||||
' close everything
|
|
||||||
cs.Close()
|
|
||||||
' this will also close the unrelying fsOut stream
|
|
||||||
fsIn.Close()
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,376 +0,0 @@
|
||||||
' Programmer: Ludvik Jerabek
|
|
||||||
' Date: 08\23\2010
|
|
||||||
' Purpose: Allow INI manipulation in .NET
|
|
||||||
|
|
||||||
Imports System.IO
|
|
||||||
Imports System.Text.RegularExpressions
|
|
||||||
Imports System.Collections
|
|
||||||
Imports System.Diagnostics
|
|
||||||
|
|
||||||
' IniFile class used to read and write ini files by loading the file into memory
|
|
||||||
Public Class IniFile
|
|
||||||
' List of IniSection objects keeps track of all the sections in the INI file
|
|
||||||
Private m_sections As Hashtable
|
|
||||||
|
|
||||||
' Public constructor
|
|
||||||
Public Sub New()
|
|
||||||
m_sections = New Hashtable(StringComparer.InvariantCultureIgnoreCase)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Loads the Reads the data in the ini file into the IniFile object
|
|
||||||
Public Sub Load(ByVal sFileName As String, Optional ByVal bMerge As Boolean = False)
|
|
||||||
If Not bMerge Then
|
|
||||||
RemoveAllSections()
|
|
||||||
End If
|
|
||||||
' Clear the object...
|
|
||||||
Dim tempsection As IniSection = Nothing
|
|
||||||
Dim oReader As New StreamReader(sFileName)
|
|
||||||
Dim regexcomment As New Regex("^([\s]*#.*)", (RegexOptions.Singleline Or RegexOptions.IgnoreCase))
|
|
||||||
' Broken but left for history
|
|
||||||
'Dim regexsection As New Regex("\[[\s]*([^\[\s].*[^\s\]])[\s]*\]", (RegexOptions.Singleline Or RegexOptions.IgnoreCase))
|
|
||||||
Dim regexsection As New Regex("^[\s]*\[[\s]*([^\[\s].*[^\s\]])[\s]*\][\s]*$", (RegexOptions.Singleline Or RegexOptions.IgnoreCase))
|
|
||||||
Dim regexkey As New Regex("^\s*([^=\s]*)[^=]*=(.*)", (RegexOptions.Singleline Or RegexOptions.IgnoreCase))
|
|
||||||
While Not oReader.EndOfStream
|
|
||||||
Dim line As String = oReader.ReadLine()
|
|
||||||
If line <> String.Empty Then
|
|
||||||
Dim m As Match = Nothing
|
|
||||||
If regexcomment.Match(line).Success Then
|
|
||||||
m = regexcomment.Match(line)
|
|
||||||
Trace.WriteLine(String.Format("Skipping Comment: {0}", m.Groups(0).Value))
|
|
||||||
ElseIf regexsection.Match(line).Success Then
|
|
||||||
m = regexsection.Match(line)
|
|
||||||
Trace.WriteLine(String.Format("Adding section [{0}]", m.Groups(1).Value))
|
|
||||||
tempsection = AddSection(m.Groups(1).Value)
|
|
||||||
ElseIf regexkey.Match(line).Success AndAlso tempsection IsNot Nothing Then
|
|
||||||
m = regexkey.Match(line)
|
|
||||||
Trace.WriteLine(String.Format("Adding Key [{0}]=[{1}]", m.Groups(1).Value, m.Groups(2).Value))
|
|
||||||
tempsection.AddKey(m.Groups(1).Value).Value = m.Groups(2).Value
|
|
||||||
ElseIf tempsection IsNot Nothing Then
|
|
||||||
' Handle Key without value
|
|
||||||
Trace.WriteLine(String.Format("Adding Key [{0}]", line))
|
|
||||||
tempsection.AddKey(line)
|
|
||||||
Else
|
|
||||||
' This should not occur unless the tempsection is not created yet...
|
|
||||||
Trace.WriteLine(String.Format("Skipping unknown type of data: {0}", line))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End While
|
|
||||||
oReader.Close()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Used to save the data back to the file or your choice
|
|
||||||
Public Sub Save(ByVal sFileName As String)
|
|
||||||
Dim oWriter As New StreamWriter(sFileName, False)
|
|
||||||
For Each s As IniSection In Sections
|
|
||||||
Trace.WriteLine(String.Format("Writing Section: [{0}]", s.Name))
|
|
||||||
oWriter.WriteLine(String.Format("[{0}]", s.Name))
|
|
||||||
For Each k As IniSection.IniKey In s.Keys
|
|
||||||
If k.Value <> String.Empty Then
|
|
||||||
Trace.WriteLine(String.Format("Writing Key: {0}={1}", k.Name, k.Value))
|
|
||||||
oWriter.WriteLine(String.Format("{0}={1}", k.Name, k.Value))
|
|
||||||
Else
|
|
||||||
Trace.WriteLine(String.Format("Writing Key: {0}", k.Name))
|
|
||||||
oWriter.WriteLine(String.Format("{0}", k.Name))
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
Next
|
|
||||||
oWriter.Close()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Gets all the sections
|
|
||||||
Public ReadOnly Property Sections() As System.Collections.ICollection
|
|
||||||
Get
|
|
||||||
Return m_sections.Values
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Adds a section to the IniFile object, returns a IniSection object to the new or existing object
|
|
||||||
Public Function AddSection(ByVal sSection As String) As IniSection
|
|
||||||
Dim s As IniSection = Nothing
|
|
||||||
sSection = sSection.Trim()
|
|
||||||
' Trim spaces
|
|
||||||
If m_sections.ContainsKey(sSection) Then
|
|
||||||
s = DirectCast(m_sections(sSection), IniSection)
|
|
||||||
Else
|
|
||||||
s = New IniSection(Me, sSection)
|
|
||||||
m_sections(sSection) = s
|
|
||||||
End If
|
|
||||||
Return s
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Removes a section by its name sSection, returns trus on success
|
|
||||||
Public Function RemoveSection(ByVal sSection As String) As Boolean
|
|
||||||
sSection = sSection.Trim()
|
|
||||||
Return RemoveSection(GetSection(sSection))
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Removes section by object, returns trus on success
|
|
||||||
Public Function RemoveSection(ByVal Section As IniSection) As Boolean
|
|
||||||
If Section IsNot Nothing Then
|
|
||||||
Try
|
|
||||||
m_sections.Remove(Section.Name)
|
|
||||||
Return True
|
|
||||||
Catch ex As Exception
|
|
||||||
Trace.WriteLine(ex.Message)
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Removes all existing sections, returns trus on success
|
|
||||||
Public Function RemoveAllSections() As Boolean
|
|
||||||
m_sections.Clear()
|
|
||||||
Return (m_sections.Count = 0)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Returns an IniSection to the section by name, NULL if it was not found
|
|
||||||
Public Function GetSection(ByVal sSection As String) As IniSection
|
|
||||||
sSection = sSection.Trim()
|
|
||||||
' Trim spaces
|
|
||||||
If m_sections.ContainsKey(sSection) Then
|
|
||||||
Return DirectCast(m_sections(sSection), IniSection)
|
|
||||||
End If
|
|
||||||
Return Nothing
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Returns a KeyValue in a certain section
|
|
||||||
Public Function GetKeyValue(ByVal sSection As String, ByVal sKey As String) As String
|
|
||||||
Dim s As IniSection = GetSection(sSection)
|
|
||||||
If s IsNot Nothing Then
|
|
||||||
Dim k As IniSection.IniKey = s.GetKey(sKey)
|
|
||||||
If k IsNot Nothing Then
|
|
||||||
Return k.Value
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Return String.Empty
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Sets a KeyValuePair in a certain section
|
|
||||||
Public Function SetKeyValue(ByVal sSection As String, ByVal sKey As String, ByVal sValue As String) As Boolean
|
|
||||||
Dim s As IniSection = AddSection(sSection)
|
|
||||||
If s IsNot Nothing Then
|
|
||||||
Dim k As IniSection.IniKey = s.AddKey(sKey)
|
|
||||||
If k IsNot Nothing Then
|
|
||||||
k.Value = sValue
|
|
||||||
Return True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Renames an existing section returns true on success, false if the section didn't exist or there was another section with the same sNewSection
|
|
||||||
Public Function RenameSection(ByVal sSection As String, ByVal sNewSection As String) As Boolean
|
|
||||||
' Note string trims are done in lower calls.
|
|
||||||
Dim bRval As Boolean = False
|
|
||||||
Dim s As IniSection = GetSection(sSection)
|
|
||||||
If s IsNot Nothing Then
|
|
||||||
bRval = s.SetName(sNewSection)
|
|
||||||
End If
|
|
||||||
Return bRval
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Renames an existing key returns true on success, false if the key didn't exist or there was another section with the same sNewKey
|
|
||||||
Public Function RenameKey(ByVal sSection As String, ByVal sKey As String, ByVal sNewKey As String) As Boolean
|
|
||||||
' Note string trims are done in lower calls.
|
|
||||||
Dim s As IniSection = GetSection(sSection)
|
|
||||||
If s IsNot Nothing Then
|
|
||||||
Dim k As IniSection.IniKey = s.GetKey(sKey)
|
|
||||||
If k IsNot Nothing Then
|
|
||||||
Return k.SetName(sNewKey)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Remove a key by section name and key name
|
|
||||||
Public Function RemoveKey(ByVal sSection As String, ByVal sKey As String) As Boolean
|
|
||||||
Dim s As IniSection = GetSection(sSection)
|
|
||||||
If s IsNot Nothing Then
|
|
||||||
Return s.RemoveKey(sKey)
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' IniSection class
|
|
||||||
Public Class IniSection
|
|
||||||
' IniFile IniFile object instance
|
|
||||||
Private m_pIniFile As IniFile
|
|
||||||
' Name of the section
|
|
||||||
Private m_sSection As String
|
|
||||||
' List of IniKeys in the section
|
|
||||||
Private m_keys As Hashtable
|
|
||||||
|
|
||||||
' Constuctor so objects are internally managed
|
|
||||||
Protected Friend Sub New(ByVal parent As IniFile, ByVal sSection As String)
|
|
||||||
m_pIniFile = parent
|
|
||||||
m_sSection = sSection
|
|
||||||
m_keys = New Hashtable(StringComparer.InvariantCultureIgnoreCase)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Returns all the keys in a section
|
|
||||||
Public ReadOnly Property Keys() As System.Collections.ICollection
|
|
||||||
Get
|
|
||||||
Return m_keys.Values
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Returns the section name
|
|
||||||
Public ReadOnly Property Name() As String
|
|
||||||
Get
|
|
||||||
Return m_sSection
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Adds a key to the IniSection object, returns a IniKey object to the new or existing object
|
|
||||||
Public Function AddKey(ByVal sKey As String) As IniKey
|
|
||||||
sKey = sKey.Trim()
|
|
||||||
Dim k As IniSection.IniKey = Nothing
|
|
||||||
If sKey.Length <> 0 Then
|
|
||||||
If m_keys.ContainsKey(sKey) Then
|
|
||||||
k = DirectCast(m_keys(sKey), IniKey)
|
|
||||||
Else
|
|
||||||
k = New IniSection.IniKey(Me, sKey)
|
|
||||||
m_keys(sKey) = k
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Return k
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Removes a single key by string
|
|
||||||
Public Function RemoveKey(ByVal sKey As String) As Boolean
|
|
||||||
Return RemoveKey(GetKey(sKey))
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Removes a single key by IniKey object
|
|
||||||
Public Function RemoveKey(ByVal Key As IniKey) As Boolean
|
|
||||||
If Key IsNot Nothing Then
|
|
||||||
Try
|
|
||||||
m_keys.Remove(Key.Name)
|
|
||||||
Return True
|
|
||||||
Catch ex As Exception
|
|
||||||
Trace.WriteLine(ex.Message)
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Removes all the keys in the section
|
|
||||||
Public Function RemoveAllKeys() As Boolean
|
|
||||||
m_keys.Clear()
|
|
||||||
Return (m_keys.Count = 0)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Returns a IniKey object to the key by name, NULL if it was not found
|
|
||||||
Public Function GetKey(ByVal sKey As String) As IniKey
|
|
||||||
sKey = sKey.Trim()
|
|
||||||
If m_keys.ContainsKey(sKey) Then
|
|
||||||
Return DirectCast(m_keys(sKey), IniKey)
|
|
||||||
End If
|
|
||||||
Return Nothing
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Sets the section name, returns true on success, fails if the section
|
|
||||||
' name sSection already exists
|
|
||||||
Public Function SetName(ByVal sSection As String) As Boolean
|
|
||||||
sSection = sSection.Trim()
|
|
||||||
If sSection.Length <> 0 Then
|
|
||||||
' Get existing section if it even exists...
|
|
||||||
Dim s As IniSection = m_pIniFile.GetSection(sSection)
|
|
||||||
If s IsNot Me AndAlso s IsNot Nothing Then
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
Try
|
|
||||||
' Remove the current section
|
|
||||||
m_pIniFile.m_sections.Remove(m_sSection)
|
|
||||||
' Set the new section name to this object
|
|
||||||
m_pIniFile.m_sections(sSection) = Me
|
|
||||||
' Set the new section name
|
|
||||||
m_sSection = sSection
|
|
||||||
Return True
|
|
||||||
Catch ex As Exception
|
|
||||||
Trace.WriteLine(ex.Message)
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Returns the section name
|
|
||||||
Public Function GetName() As String
|
|
||||||
Return m_sSection
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' IniKey class
|
|
||||||
Public Class IniKey
|
|
||||||
' Name of the Key
|
|
||||||
Private m_sKey As String
|
|
||||||
' Value associated
|
|
||||||
Private m_sValue As String
|
|
||||||
' Pointer to the parent CIniSection
|
|
||||||
Private m_section As IniSection
|
|
||||||
|
|
||||||
' Constuctor so objects are internally managed
|
|
||||||
Protected Friend Sub New(ByVal parent As IniSection, ByVal sKey As String)
|
|
||||||
m_section = parent
|
|
||||||
m_sKey = sKey
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
' Returns the name of the Key
|
|
||||||
Public ReadOnly Property Name() As String
|
|
||||||
Get
|
|
||||||
Return m_sKey
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Sets or Gets the value of the key
|
|
||||||
Public Property Value() As String
|
|
||||||
Get
|
|
||||||
Return m_sValue
|
|
||||||
End Get
|
|
||||||
Set(ByVal value As String)
|
|
||||||
m_sValue = value
|
|
||||||
End Set
|
|
||||||
End Property
|
|
||||||
|
|
||||||
' Sets the value of the key
|
|
||||||
Public Sub SetValue(ByVal sValue As String)
|
|
||||||
m_sValue = sValue
|
|
||||||
End Sub
|
|
||||||
' Returns the value of the Key
|
|
||||||
Public Function GetValue() As String
|
|
||||||
Return m_sValue
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Sets the key name
|
|
||||||
' Returns true on success, fails if the section name sKey already exists
|
|
||||||
Public Function SetName(ByVal sKey As String) As Boolean
|
|
||||||
sKey = sKey.Trim()
|
|
||||||
If sKey.Length <> 0 Then
|
|
||||||
Dim k As IniKey = m_section.GetKey(sKey)
|
|
||||||
If k IsNot Me AndAlso k IsNot Nothing Then
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
Try
|
|
||||||
' Remove the current key
|
|
||||||
m_section.m_keys.Remove(m_sKey)
|
|
||||||
' Set the new key name to this object
|
|
||||||
m_section.m_keys(sKey) = Me
|
|
||||||
' Set the new key name
|
|
||||||
m_sKey = sKey
|
|
||||||
Return True
|
|
||||||
Catch ex As Exception
|
|
||||||
Trace.WriteLine(ex.Message)
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
|
|
||||||
' Returns the name of the Key
|
|
||||||
Public Function GetName() As String
|
|
||||||
Return m_sKey
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
' End of IniKey class
|
|
||||||
End Class
|
|
||||||
' End of IniSection class
|
|
||||||
End Class
|
|
||||||
' End of IniFile class
|
|
|
@ -1,66 +0,0 @@
|
||||||
Imports System
|
|
||||||
Imports System.Collections.Generic
|
|
||||||
Imports System.Text
|
|
||||||
Imports System.Threading
|
|
||||||
Imports System.IO.Ports
|
|
||||||
Imports System.Windows.Forms
|
|
||||||
Namespace SMS
|
|
||||||
Class SmsClass
|
|
||||||
Private serialPort As SerialPort
|
|
||||||
Public Sub New(ByVal comPort As String)
|
|
||||||
Me.serialPort = New SerialPort()
|
|
||||||
Me.serialPort.PortName = comPort
|
|
||||||
Me.serialPort.BaudRate = 38400
|
|
||||||
Me.serialPort.Parity = Parity.None
|
|
||||||
Me.serialPort.DataBits = 8
|
|
||||||
Me.serialPort.StopBits = StopBits.One
|
|
||||||
Me.serialPort.Handshake = Handshake.RequestToSend
|
|
||||||
Me.serialPort.DtrEnable = True
|
|
||||||
Me.serialPort.RtsEnable = True
|
|
||||||
Me.serialPort.NewLine = System.Environment.NewLine
|
|
||||||
End Sub
|
|
||||||
Public Function sendSms(ByVal cellNo As String, ByVal sms As String, ByVal SMSC As String) As Boolean
|
|
||||||
Dim messages As String = Nothing
|
|
||||||
messages = sms
|
|
||||||
If Me.serialPort.IsOpen = True Then
|
|
||||||
Try
|
|
||||||
Me.serialPort.WriteLine("AT" + Chr(13))
|
|
||||||
Thread.Sleep(4)
|
|
||||||
Me.serialPort.WriteLine("AT+CSCA=""" + SMSC + """" + Chr(13))
|
|
||||||
Thread.Sleep(30)
|
|
||||||
Me.serialPort.WriteLine(Chr(13))
|
|
||||||
Thread.Sleep(30)
|
|
||||||
Me.serialPort.WriteLine("AT+CMGS=""" + cellNo + """")
|
|
||||||
|
|
||||||
Thread.Sleep(30)
|
|
||||||
Me.serialPort.WriteLine(messages + Chr(26))
|
|
||||||
Catch ex As Exception
|
|
||||||
MessageBox.Show(ex.Source)
|
|
||||||
End Try
|
|
||||||
Return True
|
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Sub Opens()
|
|
||||||
|
|
||||||
If Me.serialPort.IsOpen = False Then
|
|
||||||
Try
|
|
||||||
'bool ok =this.serialPort.IsOpen //does not work between 2 treads
|
|
||||||
|
|
||||||
Me.serialPort.Open()
|
|
||||||
Catch
|
|
||||||
Thread.Sleep(1000)
|
|
||||||
'wait for the port to get ready if
|
|
||||||
Opens()
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
Public Sub Closes()
|
|
||||||
If Me.serialPort.IsOpen = True Then
|
|
||||||
Me.serialPort.Close()
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
End Namespace
|
|
2
RDSFactor/My Project/Application.Designer.vb
generated
2
RDSFactor/My Project/Application.Designer.vb
generated
|
@ -1,7 +1,7 @@
|
||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
' <auto-generated>
|
' <auto-generated>
|
||||||
' This code was generated by a tool.
|
' This code was generated by a tool.
|
||||||
' Runtime Version:4.0.30319.1008
|
' Runtime Version:4.0.30319.34014
|
||||||
'
|
'
|
||||||
' Changes to this file may cause incorrect behavior and will be lost if
|
' Changes to this file may cause incorrect behavior and will be lost if
|
||||||
' the code is regenerated.
|
' the code is regenerated.
|
||||||
|
|
4
RDSFactor/My Project/Resources.Designer.vb
generated
4
RDSFactor/My Project/Resources.Designer.vb
generated
|
@ -1,7 +1,7 @@
|
||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
' <auto-generated>
|
' <auto-generated>
|
||||||
' This code was generated by a tool.
|
' This code was generated by a tool.
|
||||||
' Runtime Version:4.0.30319.1008
|
' Runtime Version:4.0.30319.34014
|
||||||
'
|
'
|
||||||
' Changes to this file may cause incorrect behavior and will be lost if
|
' Changes to this file may cause incorrect behavior and will be lost if
|
||||||
' the code is regenerated.
|
' the code is regenerated.
|
||||||
|
@ -39,7 +39,7 @@ Namespace My.Resources
|
||||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||||
Get
|
Get
|
||||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("CICRadarR.Resources", GetType(Resources).Assembly)
|
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("RDSFactor.Resources", GetType(Resources).Assembly)
|
||||||
resourceMan = temp
|
resourceMan = temp
|
||||||
End If
|
End If
|
||||||
Return resourceMan
|
Return resourceMan
|
||||||
|
|
10
RDSFactor/My Project/Settings.Designer.vb
generated
10
RDSFactor/My Project/Settings.Designer.vb
generated
|
@ -1,7 +1,7 @@
|
||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
' <auto-generated>
|
' <auto-generated>
|
||||||
' This code was generated by a tool.
|
' This code was generated by a tool.
|
||||||
' Runtime Version:4.0.30319.1008
|
' Runtime Version:4.0.30319.34014
|
||||||
'
|
'
|
||||||
' Changes to this file may cause incorrect behavior and will be lost if
|
' Changes to this file may cause incorrect behavior and will be lost if
|
||||||
' the code is regenerated.
|
' the code is regenerated.
|
||||||
|
@ -15,12 +15,12 @@ Option Explicit On
|
||||||
Namespace My
|
Namespace My
|
||||||
|
|
||||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), _
|
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
|
||||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
Partial Friend NotInheritable Class MySettings
|
Partial Friend NotInheritable Class MySettings
|
||||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||||
|
|
||||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()), MySettings)
|
||||||
|
|
||||||
#Region "My.Settings Auto-Save Functionality"
|
#Region "My.Settings Auto-Save Functionality"
|
||||||
#If _MyType = "WindowsForms" Then
|
#If _MyType = "WindowsForms" Then
|
||||||
|
@ -64,9 +64,9 @@ Namespace My
|
||||||
Friend Module MySettingsProperty
|
Friend Module MySettingsProperty
|
||||||
|
|
||||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||||
Friend ReadOnly Property Settings() As Global.CICRadarR.My.MySettings
|
Friend ReadOnly Property Settings() As Global.RDSFactor.My.MySettings
|
||||||
Get
|
Get
|
||||||
Return Global.CICRadarR.My.MySettings.Default
|
Return Global.RDSFactor.My.MySettings.Default
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
End Module
|
End Module
|
||||||
|
|
|
@ -7,6 +7,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RDSFactor", "RDSFactor.vbpr
|
||||||
EndProject
|
EndProject
|
||||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RADAR", "..\radar-radius\RADAR\RADAR.vbproj", "{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}"
|
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RADAR", "..\radar-radius\RADAR\RADAR.vbproj", "{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CICRadarRConfig", "..\Console\CICRadarRConfig\CICRadarRConfig\CICRadarRConfig.vbproj", "{698299A4-5778-4EE0-9C46-445A9B66F645}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -37,6 +39,16 @@ Global
|
||||||
{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}.Release|x86.ActiveCfg = Release|Any CPU
|
{3AB08A4E-C4FA-4571-A5D4-32BBA807C31D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|Mixed Platforms.Build.0 = Debug|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|Any CPU.ActiveCfg = Release|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|Mixed Platforms.ActiveCfg = Release|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|x86.Build.0 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
Imports System.DirectoryServices
|
Imports System.DirectoryServices
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Reflection
|
Imports System.Reflection
|
||||||
Imports CICRadarR.SMS
|
Imports RDSFactor.SMSModem
|
||||||
Imports CICRadarR.LogFile
|
Imports RDSFactor.LogFile
|
||||||
Imports System.Security.Cryptography
|
Imports System.Security.Cryptography
|
||||||
Imports System.Text
|
Imports System.Text
|
||||||
Imports System
|
Imports System
|
||||||
|
@ -275,9 +275,9 @@ Public Class RDSFactor
|
||||||
|
|
||||||
' test if using online sms provider or local modem
|
' test if using online sms provider or local modem
|
||||||
If ModemType = 1 Then ' local modem
|
If ModemType = 1 Then ' local modem
|
||||||
Dim modem As New SmsClass(ComPort)
|
Dim modem As New SMSModem(ComPort)
|
||||||
modem.Opens()
|
modem.Opens()
|
||||||
modem.sendSms(number, passcode, SmsC)
|
modem.send(number, passcode, SmsC)
|
||||||
modem.Closes()
|
modem.Closes()
|
||||||
modem = Nothing
|
modem = Nothing
|
||||||
Return "Ok"
|
Return "Ok"
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
<ProjectGuid>{04C6C533-9FEA-41B2-B554-A166C7C7FE32}</ProjectGuid>
|
<ProjectGuid>{04C6C533-9FEA-41B2-B554-A166C7C7FE32}</ProjectGuid>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<StartupObject>Sub Main</StartupObject>
|
<StartupObject>Sub Main</StartupObject>
|
||||||
<RootNamespace>CICRadarR</RootNamespace>
|
<RootNamespace>RDSFactor</RootNamespace>
|
||||||
<AssemblyName>CICRadarR</AssemblyName>
|
<AssemblyName>RDSFactor</AssemblyName>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<MyType>Console</MyType>
|
<MyType>Console</MyType>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
<DefineDebug>true</DefineDebug>
|
<DefineDebug>true</DefineDebug>
|
||||||
<DefineTrace>true</DefineTrace>
|
<DefineTrace>true</DefineTrace>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DocumentationFile>CICRadarR.xml</DocumentationFile>
|
<DocumentationFile>RDSFactor.xml</DocumentationFile>
|
||||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
<DefineTrace>true</DefineTrace>
|
<DefineTrace>true</DefineTrace>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DocumentationFile>CICRadarR.xml</DocumentationFile>
|
<DocumentationFile>RDSFactor.xml</DocumentationFile>
|
||||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
<Compile Include="ProjectInstaller.vb">
|
<Compile Include="ProjectInstaller.vb">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="SmsClass.vb" />
|
<Compile Include="SMSModemSender.vb" />
|
||||||
<Compile Include="TestService.Designer.vb">
|
<Compile Include="TestService.Designer.vb">
|
||||||
<DependentUpon>TestService.vb</DependentUpon>
|
<DependentUpon>TestService.vb</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
69
RDSFactor/SMSModem.vb
Normal file
69
RDSFactor/SMSModem.vb
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
Imports System
|
||||||
|
Imports System.Collections.Generic
|
||||||
|
Imports System.Text
|
||||||
|
Imports System.Threading
|
||||||
|
Imports System.IO.Ports
|
||||||
|
Imports System.Windows.Forms
|
||||||
|
|
||||||
|
Public Class SMSModem
|
||||||
|
|
||||||
|
Private serialPort As SerialPort
|
||||||
|
|
||||||
|
Public Sub New(ByVal comPort As String)
|
||||||
|
Me.serialPort = New SerialPort()
|
||||||
|
Me.serialPort.PortName = comPort
|
||||||
|
Me.serialPort.BaudRate = 38400
|
||||||
|
Me.serialPort.Parity = Parity.None
|
||||||
|
Me.serialPort.DataBits = 8
|
||||||
|
Me.serialPort.StopBits = StopBits.One
|
||||||
|
Me.serialPort.Handshake = Handshake.RequestToSend
|
||||||
|
Me.serialPort.DtrEnable = True
|
||||||
|
Me.serialPort.RtsEnable = True
|
||||||
|
Me.serialPort.NewLine = System.Environment.NewLine
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function send(ByVal cellNo As String, ByVal sms As String, ByVal SMSC As String) As Boolean
|
||||||
|
Dim messages As String = Nothing
|
||||||
|
messages = sms
|
||||||
|
If Me.serialPort.IsOpen = True Then
|
||||||
|
Try
|
||||||
|
Me.serialPort.WriteLine("AT" + Chr(13))
|
||||||
|
Thread.Sleep(4)
|
||||||
|
Me.serialPort.WriteLine("AT+CSCA=""" + SMSC + """" + Chr(13))
|
||||||
|
Thread.Sleep(30)
|
||||||
|
Me.serialPort.WriteLine(Chr(13))
|
||||||
|
Thread.Sleep(30)
|
||||||
|
Me.serialPort.WriteLine("AT+CMGS=""" + cellNo + """")
|
||||||
|
|
||||||
|
Thread.Sleep(30)
|
||||||
|
Me.serialPort.WriteLine(messages + Chr(26))
|
||||||
|
Catch ex As Exception
|
||||||
|
MessageBox.Show(ex.Source)
|
||||||
|
End Try
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Sub Opens()
|
||||||
|
|
||||||
|
If Me.serialPort.IsOpen = False Then
|
||||||
|
Try
|
||||||
|
'bool ok =this.serialPort.IsOpen //does not work between 2 treads
|
||||||
|
|
||||||
|
Me.serialPort.Open()
|
||||||
|
Catch
|
||||||
|
Thread.Sleep(1000)
|
||||||
|
'wait for the port to get ready if
|
||||||
|
Opens()
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Public Sub Closes()
|
||||||
|
If Me.serialPort.IsOpen = True Then
|
||||||
|
Me.serialPort.Close()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
End Class
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
Imports System
|
|
||||||
Imports System.Collections.Generic
|
|
||||||
Imports System.Text
|
|
||||||
Imports System.Threading
|
|
||||||
Imports System.IO.Ports
|
|
||||||
Imports System.Windows.Forms
|
|
||||||
Namespace SMS
|
|
||||||
Class SmsClass
|
|
||||||
Private serialPort As SerialPort
|
|
||||||
Public Sub New(ByVal comPort As String)
|
|
||||||
Me.serialPort = New SerialPort()
|
|
||||||
Me.serialPort.PortName = comPort
|
|
||||||
Me.serialPort.BaudRate = 38400
|
|
||||||
Me.serialPort.Parity = Parity.None
|
|
||||||
Me.serialPort.DataBits = 8
|
|
||||||
Me.serialPort.StopBits = StopBits.One
|
|
||||||
Me.serialPort.Handshake = Handshake.RequestToSend
|
|
||||||
Me.serialPort.DtrEnable = True
|
|
||||||
Me.serialPort.RtsEnable = True
|
|
||||||
Me.serialPort.NewLine = System.Environment.NewLine
|
|
||||||
End Sub
|
|
||||||
Public Function sendSms(ByVal cellNo As String, ByVal sms As String, ByVal SMSC As String) As Boolean
|
|
||||||
Dim messages As String = Nothing
|
|
||||||
messages = sms
|
|
||||||
If Me.serialPort.IsOpen = True Then
|
|
||||||
Try
|
|
||||||
Me.serialPort.WriteLine("AT" + Chr(13))
|
|
||||||
Thread.Sleep(4)
|
|
||||||
Me.serialPort.WriteLine("AT+CSCA=""" + SMSC + """" + Chr(13))
|
|
||||||
Thread.Sleep(30)
|
|
||||||
Me.serialPort.WriteLine(Chr(13))
|
|
||||||
Thread.Sleep(30)
|
|
||||||
Me.serialPort.WriteLine("AT+CMGS=""" + cellNo + """")
|
|
||||||
|
|
||||||
Thread.Sleep(30)
|
|
||||||
Me.serialPort.WriteLine(messages + Chr(26))
|
|
||||||
Catch ex As Exception
|
|
||||||
MessageBox.Show(ex.Source)
|
|
||||||
End Try
|
|
||||||
Return True
|
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Sub Opens()
|
|
||||||
|
|
||||||
If Me.serialPort.IsOpen = False Then
|
|
||||||
Try
|
|
||||||
'bool ok =this.serialPort.IsOpen //does not work between 2 treads
|
|
||||||
|
|
||||||
Me.serialPort.Open()
|
|
||||||
Catch
|
|
||||||
Thread.Sleep(1000)
|
|
||||||
'wait for the port to get ready if
|
|
||||||
Opens()
|
|
||||||
End Try
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
Public Sub Closes()
|
|
||||||
If Me.serialPort.IsOpen = True Then
|
|
||||||
Me.serialPort.Close()
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
End Namespace
|
|
|
@ -1,4 +1,4 @@
|
||||||
Imports CICRadarR
|
Imports RDSFactor
|
||||||
|
|
||||||
Public Class TestService
|
Public Class TestService
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
Imports CICRadarRConfig.SMS
|
Imports RDSFactor
|
||||||
|
|
||||||
Imports System.ServiceProcess
|
Imports System.ServiceProcess
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Net.Mail
|
Imports System.Net.Mail
|
||||||
|
@ -257,7 +258,7 @@ Public Class CICRadiusRConfig
|
||||||
|
|
||||||
|
|
||||||
Private Sub btnTestModem_Click(sender As System.Object, e As System.EventArgs) Handles btnTestModem.Click
|
Private Sub btnTestModem_Click(sender As System.Object, e As System.EventArgs) Handles btnTestModem.Click
|
||||||
Call TestModem()
|
Call TestSMS()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
@ -434,13 +435,13 @@ Public Class CICRadiusRConfig
|
||||||
MsgBox("Configuration tool for CICRadar." & vbCrLf & vbCrLf & "Version 1.1", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "About")
|
MsgBox("Configuration tool for CICRadar." & vbCrLf & vbCrLf & "Version 1.1", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "About")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub TestModem()
|
Sub TestSMS()
|
||||||
Dim number As String
|
Dim number As String
|
||||||
number = InputBox("Type the phone number to send the test sms to" & vbCrLf & vbCrLf & "Ex: +4512345678", "Phone Number", "", Me.Left + 150, Me.Top + 100)
|
number = InputBox("Type the phone number to send the test sms to" & vbCrLf & vbCrLf & "Ex: +4512345678", "Phone Number", "", Me.Left + 150, Me.Top + 100)
|
||||||
If rbLocalSMS.Checked = True Then
|
If rbLocalSMS.Checked = True Then
|
||||||
Dim testsms As New SmsClass(txtComPort.Text)
|
Dim testsms As New SMSModem(txtComPort.Text)
|
||||||
testsms.Opens()
|
testsms.Opens()
|
||||||
testsms.sendSms(number, "Test SMS Service", txtSMSC.Text)
|
testsms.send(number, "Test SMS Service", txtSMSC.Text)
|
||||||
testsms.Closes()
|
testsms.Closes()
|
||||||
Else
|
Else
|
||||||
Dim baseurl As String = txtProvider.Text.Split("?")(0)
|
Dim baseurl As String = txtProvider.Text.Split("?")(0)
|
||||||
|
@ -501,7 +502,7 @@ Public Class CICRadiusRConfig
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub TestModemConfigurationToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TestModemConfigurationToolStripMenuItem.Click
|
Private Sub TestModemConfigurationToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TestModemConfigurationToolStripMenuItem.Click
|
||||||
Call TestModem()
|
Call TestSMS()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub TestMailConfigurationToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TestMailConfigurationToolStripMenuItem.Click
|
Private Sub TestMailConfigurationToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TestMailConfigurationToolStripMenuItem.Click
|
|
@ -1,7 +1,7 @@
|
||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
' <auto-generated>
|
' <auto-generated>
|
||||||
' This code was generated by a tool.
|
' This code was generated by a tool.
|
||||||
' Runtime Version:4.0.30319.1008
|
' Runtime Version:4.0.30319.34014
|
||||||
'
|
'
|
||||||
' Changes to this file may cause incorrect behavior and will be lost if
|
' Changes to this file may cause incorrect behavior and will be lost if
|
||||||
' the code is regenerated.
|
' the code is regenerated.
|
||||||
|
@ -32,7 +32,7 @@ Namespace My
|
||||||
|
|
||||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||||
Protected Overrides Sub OnCreateMainForm()
|
Protected Overrides Sub OnCreateMainForm()
|
||||||
Me.MainForm = Global.CICRadarRConfig.CICRadiusRConfig
|
Me.MainForm = Global.RDSFactorConfig.CICRadiusRConfig
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
|
@ -1,7 +1,7 @@
|
||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
' <auto-generated>
|
' <auto-generated>
|
||||||
' This code was generated by a tool.
|
' This code was generated by a tool.
|
||||||
' Runtime Version:4.0.30319.1008
|
' Runtime Version:4.0.30319.34014
|
||||||
'
|
'
|
||||||
' Changes to this file may cause incorrect behavior and will be lost if
|
' Changes to this file may cause incorrect behavior and will be lost if
|
||||||
' the code is regenerated.
|
' the code is regenerated.
|
||||||
|
@ -39,7 +39,7 @@ Namespace My.Resources
|
||||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||||
Get
|
Get
|
||||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("CICRadarRConfig.Resources", GetType(Resources).Assembly)
|
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("RDSFactorConfig.Resources", GetType(Resources).Assembly)
|
||||||
resourceMan = temp
|
resourceMan = temp
|
||||||
End If
|
End If
|
||||||
Return resourceMan
|
Return resourceMan
|
|
@ -1,7 +1,7 @@
|
||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
' <auto-generated>
|
' <auto-generated>
|
||||||
' This code was generated by a tool.
|
' This code was generated by a tool.
|
||||||
' Runtime Version:4.0.30319.1008
|
' Runtime Version:4.0.30319.34014
|
||||||
'
|
'
|
||||||
' Changes to this file may cause incorrect behavior and will be lost if
|
' Changes to this file may cause incorrect behavior and will be lost if
|
||||||
' the code is regenerated.
|
' the code is regenerated.
|
||||||
|
@ -15,12 +15,12 @@ Option Explicit On
|
||||||
Namespace My
|
Namespace My
|
||||||
|
|
||||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), _
|
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
|
||||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
Partial Friend NotInheritable Class MySettings
|
Partial Friend NotInheritable Class MySettings
|
||||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||||
|
|
||||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()), MySettings)
|
||||||
|
|
||||||
#Region "My.Settings Auto-Save Functionality"
|
#Region "My.Settings Auto-Save Functionality"
|
||||||
#If _MyType = "WindowsForms" Then
|
#If _MyType = "WindowsForms" Then
|
||||||
|
@ -64,9 +64,9 @@ Namespace My
|
||||||
Friend Module MySettingsProperty
|
Friend Module MySettingsProperty
|
||||||
|
|
||||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||||
Friend ReadOnly Property Settings() As Global.CICRadarRConfig.My.MySettings
|
Friend ReadOnly Property Settings() As Global.RDSFactorConfig.My.MySettings
|
||||||
Get
|
Get
|
||||||
Return Global.CICRadarRConfig.My.MySettings.Default
|
Return Global.RDSFactorConfig.My.MySettings.Default
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
End Module
|
End Module
|
28
RDSFactorConfig/RDSFactorConfig.sln
Normal file
28
RDSFactorConfig/RDSFactorConfig.sln
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Express 2013 for Windows Desktop
|
||||||
|
VisualStudioVersion = 12.0.31101.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RDSFactorConfig", "RDSFactorConfig.vbproj", "{698299A4-5778-4EE0-9C46-445A9B66F645}"
|
||||||
|
EndProject
|
||||||
|
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RDSFactor", "..\RDSFactor\RDSFactor.vbproj", "{04C6C533-9FEA-41B2-B554-A166C7C7FE32}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{698299A4-5778-4EE0-9C46-445A9B66F645}.Release|x86.Build.0 = Release|x86
|
||||||
|
{04C6C533-9FEA-41B2-B554-A166C7C7FE32}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{04C6C533-9FEA-41B2-B554-A166C7C7FE32}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{04C6C533-9FEA-41B2-B554-A166C7C7FE32}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{04C6C533-9FEA-41B2-B554-A166C7C7FE32}.Release|x86.Build.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -8,9 +8,9 @@
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{698299A4-5778-4EE0-9C46-445A9B66F645}</ProjectGuid>
|
<ProjectGuid>{698299A4-5778-4EE0-9C46-445A9B66F645}</ProjectGuid>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<StartupObject>CICRadarRConfig.My.MyApplication</StartupObject>
|
<StartupObject>RDSFactorConfig.My.MyApplication</StartupObject>
|
||||||
<RootNamespace>CICRadarRConfig</RootNamespace>
|
<RootNamespace>RDSFactorConfig</RootNamespace>
|
||||||
<AssemblyName>CICRadarRConfig</AssemblyName>
|
<AssemblyName>RDSFactorConfig</AssemblyName>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<MyType>WindowsForms</MyType>
|
<MyType>WindowsForms</MyType>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
<DefineDebug>true</DefineDebug>
|
<DefineDebug>true</DefineDebug>
|
||||||
<DefineTrace>true</DefineTrace>
|
<DefineTrace>true</DefineTrace>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DocumentationFile>CICRadarRConfig.xml</DocumentationFile>
|
<DocumentationFile>RDSFactorConfig.xml</DocumentationFile>
|
||||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
<DefineTrace>true</DefineTrace>
|
<DefineTrace>true</DefineTrace>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DocumentationFile>CICRadarRConfig.xml</DocumentationFile>
|
<DocumentationFile>RDSFactorConfig.xml</DocumentationFile>
|
||||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
@ -92,8 +92,6 @@
|
||||||
<Import Include="System.Xml.Linq" />
|
<Import Include="System.Xml.Linq" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Crypto.vb" />
|
|
||||||
<Compile Include="IniFileVb.vb" />
|
|
||||||
<Compile Include="Main.vb">
|
<Compile Include="Main.vb">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -116,7 +114,6 @@
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="SmsClass.vb" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Main.resx">
|
<EmbeddedResource Include="Main.resx">
|
||||||
|
@ -166,6 +163,16 @@
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\radar-radius\RADAR\RADAR.vbproj">
|
||||||
|
<Project>{3ab08a4e-c4fa-4571-a5d4-32bba807c31d}</Project>
|
||||||
|
<Name>RADAR</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\RDSFactor\RDSFactor.vbproj">
|
||||||
|
<Project>{04c6c533-9fea-41b2-b554-a166c7c7fe32}</Project>
|
||||||
|
<Name>RDSFactor</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
BIN
RDSFactorConfig/bin/Debug/CICRadarRConfig.exe
Normal file
BIN
RDSFactorConfig/bin/Debug/CICRadarRConfig.exe
Normal file
Binary file not shown.
BIN
RDSFactorConfig/bin/Debug/CICRadarRConfig.pdb
Normal file
BIN
RDSFactorConfig/bin/Debug/CICRadarRConfig.pdb
Normal file
Binary file not shown.
BIN
RDSFactorConfig/bin/Debug/RADAR.dll
Normal file
BIN
RDSFactorConfig/bin/Debug/RADAR.dll
Normal file
Binary file not shown.
BIN
RDSFactorConfig/bin/Debug/RADAR.pdb
Normal file
BIN
RDSFactorConfig/bin/Debug/RADAR.pdb
Normal file
Binary file not shown.
66
RDSFactorConfig/bin/Debug/RADAR.xml
Normal file
66
RDSFactorConfig/bin/Debug/RADAR.xml
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<doc>
|
||||||
|
<assembly>
|
||||||
|
<name>
|
||||||
|
RADAR
|
||||||
|
</name>
|
||||||
|
</assembly>
|
||||||
|
<members>
|
||||||
|
<member name="P:RADAR.My.Resources.Resources.ResourceManager">
|
||||||
|
<summary>
|
||||||
|
Returns the cached ResourceManager instance used by this class.
|
||||||
|
</summary>
|
||||||
|
</member><member name="P:RADAR.My.Resources.Resources.Culture">
|
||||||
|
<summary>
|
||||||
|
Overrides the current thread's CurrentUICulture property for all
|
||||||
|
resource lookups using this strongly typed resource class.
|
||||||
|
</summary>
|
||||||
|
</member><member name="T:RADAR.My.Resources.Resources">
|
||||||
|
<summary>
|
||||||
|
A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
</summary>
|
||||||
|
</member><member name="P:RADAR.RADIUSPacket.UserName">
|
||||||
|
<summary>
|
||||||
|
Returns the username supplied in an Access Request. Returns
|
||||||
|
Nothing if a User-Name attribute is missing or the packet is not an
|
||||||
|
Access Request.
|
||||||
|
</summary>
|
||||||
|
<value></value>
|
||||||
|
<returns></returns>
|
||||||
|
<remarks></remarks>
|
||||||
|
</member><member name="P:RADAR.RADIUSPacket.UserPassword">
|
||||||
|
<summary>
|
||||||
|
Returns the password supplied in an Access Request. Returns
|
||||||
|
Nothing is a User-Password attribute is missing or the packet is not
|
||||||
|
an Access Request.
|
||||||
|
</summary>
|
||||||
|
<value></value>
|
||||||
|
<returns></returns>
|
||||||
|
<remarks></remarks>
|
||||||
|
</member><member name="M:RADAR.RADIUSPacket.AuthenticateAccessRequest(RADAR.NASAuthList@,RADAR.NASAuthList@)">
|
||||||
|
<summary>
|
||||||
|
Deprecated. User the UserName and UserPassword properties instead.
|
||||||
|
</summary>
|
||||||
|
<param name="authList"></param>
|
||||||
|
<param name="nasList"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<remarks></remarks>
|
||||||
|
</member><member name="M:RADAR.RADIUSPacket.AcceptAccessRequest">
|
||||||
|
<summary>
|
||||||
|
Accept the access request.
|
||||||
|
</summary>
|
||||||
|
<remarks></remarks>
|
||||||
|
</member><member name="M:RADAR.RADIUSPacket.AcceptAccessRequest(RADAR.RADIUSAttributes)">
|
||||||
|
<summary>
|
||||||
|
Accept the access request and include the specified attributes in the RADIUS response.
|
||||||
|
</summary>
|
||||||
|
<param name="attributes">The RADIUS attributes to include with the response.</param>
|
||||||
|
<remarks></remarks>
|
||||||
|
</member><member name="M:RADAR.RADIUSPacket.RejectAccessRequest">
|
||||||
|
<summary>
|
||||||
|
Reject the access request.
|
||||||
|
</summary>
|
||||||
|
<remarks></remarks>
|
||||||
|
</member>
|
||||||
|
</members>
|
||||||
|
</doc>
|
BIN
RDSFactorConfig/bin/Debug/RDSFactor.exe
Normal file
BIN
RDSFactorConfig/bin/Debug/RDSFactor.exe
Normal file
Binary file not shown.
BIN
RDSFactorConfig/bin/Debug/RDSFactor.pdb
Normal file
BIN
RDSFactorConfig/bin/Debug/RDSFactor.pdb
Normal file
Binary file not shown.
24
RDSFactorConfig/bin/Debug/RDSFactor.xml
Normal file
24
RDSFactorConfig/bin/Debug/RDSFactor.xml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<doc>
|
||||||
|
<assembly>
|
||||||
|
<name>
|
||||||
|
RDSFactor
|
||||||
|
</name>
|
||||||
|
</assembly>
|
||||||
|
<members>
|
||||||
|
<member name="P:RDSFactor.My.Resources.Resources.ResourceManager">
|
||||||
|
<summary>
|
||||||
|
Returns the cached ResourceManager instance used by this class.
|
||||||
|
</summary>
|
||||||
|
</member><member name="P:RDSFactor.My.Resources.Resources.Culture">
|
||||||
|
<summary>
|
||||||
|
Overrides the current thread's CurrentUICulture property for all
|
||||||
|
resource lookups using this strongly typed resource class.
|
||||||
|
</summary>
|
||||||
|
</member><member name="T:RDSFactor.My.Resources.Resources">
|
||||||
|
<summary>
|
||||||
|
A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
</members>
|
||||||
|
</doc>
|
BIN
RDSFactorConfig/bin/Debug/RDSFactorConfig.exe
Normal file
BIN
RDSFactorConfig/bin/Debug/RDSFactorConfig.exe
Normal file
Binary file not shown.
23
RDSFactorConfig/bin/Debug/RDSFactorConfig.exe.config
Normal file
23
RDSFactorConfig/bin/Debug/RDSFactorConfig.exe.config
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<configuration>
|
||||||
|
<system.diagnostics>
|
||||||
|
<sources>
|
||||||
|
<!-- This section defines the logging configuration for My.Application.Log -->
|
||||||
|
<source name="DefaultSource" switchName="DefaultSwitch">
|
||||||
|
<listeners>
|
||||||
|
<add name="FileLog"/>
|
||||||
|
<!-- Uncomment the below section to write to the Application Event Log -->
|
||||||
|
<!--<add name="EventLog"/>-->
|
||||||
|
</listeners>
|
||||||
|
</source>
|
||||||
|
</sources>
|
||||||
|
<switches>
|
||||||
|
<add name="DefaultSwitch" value="Information"/>
|
||||||
|
</switches>
|
||||||
|
<sharedListeners>
|
||||||
|
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
|
||||||
|
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
|
||||||
|
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
|
||||||
|
</sharedListeners>
|
||||||
|
</system.diagnostics>
|
||||||
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
BIN
RDSFactorConfig/bin/Debug/RDSFactorConfig.pdb
Normal file
BIN
RDSFactorConfig/bin/Debug/RDSFactorConfig.pdb
Normal file
Binary file not shown.
BIN
RDSFactorConfig/bin/Debug/RDSFactorConfig.vshost.exe
Normal file
BIN
RDSFactorConfig/bin/Debug/RDSFactorConfig.vshost.exe
Normal file
Binary file not shown.
23
RDSFactorConfig/bin/Debug/RDSFactorConfig.vshost.exe.config
Normal file
23
RDSFactorConfig/bin/Debug/RDSFactorConfig.vshost.exe.config
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<configuration>
|
||||||
|
<system.diagnostics>
|
||||||
|
<sources>
|
||||||
|
<!-- This section defines the logging configuration for My.Application.Log -->
|
||||||
|
<source name="DefaultSource" switchName="DefaultSwitch">
|
||||||
|
<listeners>
|
||||||
|
<add name="FileLog"/>
|
||||||
|
<!-- Uncomment the below section to write to the Application Event Log -->
|
||||||
|
<!--<add name="EventLog"/>-->
|
||||||
|
</listeners>
|
||||||
|
</source>
|
||||||
|
</sources>
|
||||||
|
<switches>
|
||||||
|
<add name="DefaultSwitch" value="Information"/>
|
||||||
|
</switches>
|
||||||
|
<sharedListeners>
|
||||||
|
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
|
||||||
|
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
|
||||||
|
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
|
||||||
|
</sharedListeners>
|
||||||
|
</system.diagnostics>
|
||||||
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
</assembly>
|
24
RDSFactorConfig/bin/Debug/RDSFactorConfig.xml
Normal file
24
RDSFactorConfig/bin/Debug/RDSFactorConfig.xml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<doc>
|
||||||
|
<assembly>
|
||||||
|
<name>
|
||||||
|
RDSFactorConfig
|
||||||
|
</name>
|
||||||
|
</assembly>
|
||||||
|
<members>
|
||||||
|
<member name="P:RDSFactorConfig.My.Resources.Resources.ResourceManager">
|
||||||
|
<summary>
|
||||||
|
Returns the cached ResourceManager instance used by this class.
|
||||||
|
</summary>
|
||||||
|
</member><member name="P:RDSFactorConfig.My.Resources.Resources.Culture">
|
||||||
|
<summary>
|
||||||
|
Overrides the current thread's CurrentUICulture property for all
|
||||||
|
resource lookups using this strongly typed resource class.
|
||||||
|
</summary>
|
||||||
|
</member><member name="T:RDSFactorConfig.My.Resources.Resources">
|
||||||
|
<summary>
|
||||||
|
A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
</members>
|
||||||
|
</doc>
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Loading…
Add table
Add a link
Reference in a new issue