mirror of
https://github.com/romanlryji/EventLogLoader.git
synced 2024-11-24 08:32:52 +02:00
clean up
This commit is contained in:
parent
0e8e286d57
commit
ea8983961c
@ -1,386 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
|
||||
Public Class IniFileClass
|
||||
' 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 IniFileClass
|
||||
' 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 IniFileClass, 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
|
||||
|
||||
Public Function RestoreIniValue(Param As IniFileClass, SectionText As String, KeyText As String) As String
|
||||
Dim Section As IniFileClass.IniSection = Param.GetSection(SectionText)
|
||||
If Not Section Is Nothing Then
|
||||
Dim Key As IniFileClass.IniSection.IniKey = Section.GetKey(KeyText)
|
||||
If Not Key Is Nothing Then
|
||||
RestoreIniValue = Key.Value
|
||||
Else
|
||||
RestoreIniValue = ""
|
||||
End If
|
||||
Else
|
||||
RestoreIniValue = ""
|
||||
End If
|
||||
End Function
|
||||
' End of IniSection class
|
||||
End Class
|
||||
|
||||
|
@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>
|
||||
</SchemaVersion>
|
||||
<ProjectGuid>{8119A1A1-E5D6-4269-9A5C-0F49E039E72D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>IniFile</RootNamespace>
|
||||
<AssemblyName>IniFile</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>IniFile.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>IniFile.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
13
IniFile/My Project/Application.Designer.vb
generated
13
IniFile/My Project/Application.Designer.vb
generated
@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
@ -1,35 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Общие сведения об этой сборке предоставляются следующим набором
|
||||
' атрибутов. Отредактируйте значения этих атрибутов, чтобы изменить
|
||||
' общие сведения об этой сборке.
|
||||
|
||||
' Проверьте значения атрибутов сборки
|
||||
|
||||
<Assembly: AssemblyTitle("IniFile")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("IniFile")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2013")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
<Assembly: Guid("204c055a-37ab-4eeb-a0d1-93682284d65b")>
|
||||
|
||||
' Сведения о версии сборки состоят из следующих четырех значений:
|
||||
'
|
||||
' Основной номер версии
|
||||
' Дополнительный номер версии
|
||||
' Номер построения
|
||||
' Редакция
|
||||
'
|
||||
' Можно задать все значения или принять номер построения и номер редакции по умолчанию,
|
||||
' используя "*", как показано ниже:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
63
IniFile/My Project/Resources.Designer.vb
generated
63
IniFile/My Project/Resources.Designer.vb
generated
@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("IniFile.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
73
IniFile/My Project/Settings.Designer.vb
generated
73
IniFile/My Project/Settings.Designer.vb
generated
@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.IniFile.My.MySettings
|
||||
Get
|
||||
Return Global.IniFile.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
@ -1,220 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Runtime.InteropServices
|
||||
Namespace ObjTec.Services
|
||||
Friend Class NativeMethods
|
||||
Private Sub New()
|
||||
End Sub
|
||||
<DllImport("advapi32.dll", EntryPoint:="OpenSCManagerW", ExactSpelling:=True, CharSet:=CharSet.Unicode, SetLastError:=True)> _
|
||||
Friend Shared Function OpenSCManager(machineName As String, databaseName As String, dwAccess As UInteger) As IntPtr
|
||||
End Function
|
||||
<DllImport("advapi32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
|
||||
Friend Shared Function CreateService(hSCManager As IntPtr, lpServiceName As String, lpDisplayName As String, dwDesiredAccess As UInteger, dwServiceType As UInteger, dwStartType As UInteger, _
|
||||
dwErrorControl As UInteger, lpBinaryPathName As String, lpLoadOrderGroup As String, lpdwTagId As UInteger, lpDependencies As String, lpServiceStartName As String, _
|
||||
lpPassword As String) As IntPtr
|
||||
End Function
|
||||
<DllImport("advapi32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
|
||||
Friend Shared Function ChangeServiceConfig(hService As IntPtr, dwServiceType As UInteger, dwStartType As UInteger, dwErrorControl As UInteger, _
|
||||
lpBinaryPathName As String, lpLoadOrderGroup As String, lpdwTagId As UInteger, lpDependencies As String, lpServiceStartName As String, _
|
||||
lpPassword As String, lpDisplayName As String) As IntPtr
|
||||
End Function
|
||||
<DllImport("advapi32.dll")> _
|
||||
Friend Shared Function CloseServiceHandle(scHandle As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
|
||||
End Function
|
||||
<DllImport("advapi32", SetLastError:=True)> _
|
||||
Friend Shared Function StartService(hService As IntPtr, dwNumServiceArgs As Integer, lpServiceArgVectors As String()) As <MarshalAs(UnmanagedType.Bool)> Boolean
|
||||
End Function
|
||||
<DllImport("advapi32.dll", SetLastError:=True)> _
|
||||
Friend Shared Function OpenService(scHandle As IntPtr, lpSvcName As String, dwNumServiceArgs As Integer) As IntPtr
|
||||
End Function
|
||||
<DllImport("advapi32.dll")> _
|
||||
Friend Shared Function DeleteService(svHandle As IntPtr) As Integer
|
||||
End Function
|
||||
End Class
|
||||
Public Class ServiceInstaller
|
||||
Public Shared Function InstallService(svcPath As String, svcName As String, svcDispName As String, lpDependencies As String, User As String, Password As String) As Boolean
|
||||
Dim SC_MANAGER_CREATE_SERVICE As UInteger = &H2
|
||||
Dim SC_MANAGER_ALL_ACCESS As UInteger = &HF003F
|
||||
Dim SERVICE_WIN32_OWN_PROCESS As UInteger = &H10
|
||||
Dim SERVICE_ERROR_NORMAL As UInteger = &H1
|
||||
Dim STANDARD_RIGHTS_REQUIRED As UInteger = &HF0000
|
||||
Dim SERVICE_QUERY_CONFIG As UInteger = &H1
|
||||
Dim SERVICE_CHANGE_CONFIG As UInteger = &H2
|
||||
Dim SERVICE_QUERY_STATUS As UInteger = &H4
|
||||
Dim SERVICE_ENUMERATE_DEPENDENTS As UInteger = &H8
|
||||
Dim SERVICE_START As UInteger = &H10
|
||||
Dim SERVICE_STOP As UInteger = &H20
|
||||
Dim SERVICE_PAUSE_CONTINUE As UInteger = &H40
|
||||
Dim SERVICE_INTERROGATE As UInteger = &H80
|
||||
Dim SERVICE_USER_DEFINED_CONTROL As UInteger = &H100
|
||||
Dim SERVICE_ALL_ACCESS As UInteger = (STANDARD_RIGHTS_REQUIRED Or SERVICE_QUERY_CONFIG Or SERVICE_CHANGE_CONFIG Or SERVICE_QUERY_STATUS Or SERVICE_ENUMERATE_DEPENDENTS Or SERVICE_START Or SERVICE_STOP Or SERVICE_PAUSE_CONTINUE Or SERVICE_INTERROGATE Or SERVICE_USER_DEFINED_CONTROL)
|
||||
Dim SERVICE_AUTO_START As UInteger = &H2
|
||||
Dim sc_handle As IntPtr = NativeMethods.OpenSCManager(Nothing, Nothing, SC_MANAGER_ALL_ACCESS)
|
||||
If Not sc_handle.Equals(IntPtr.Zero) Then
|
||||
Dim sv_handle As IntPtr = NativeMethods.CreateService(sc_handle, svcName, svcDispName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, _
|
||||
SERVICE_ERROR_NORMAL, svcPath, Nothing, 0, lpDependencies, User, IIf(Password = "", Nothing, Password))
|
||||
If sv_handle.Equals(IntPtr.Zero) Then
|
||||
'Console.WriteLine(Marshal.GetLastWin32Error())
|
||||
NativeMethods.CloseServiceHandle(sv_handle)
|
||||
NativeMethods.CloseServiceHandle(sc_handle)
|
||||
Return False
|
||||
Else
|
||||
'Dim test As Boolean = NativeMethods.StartService(sv_handle, 0, Nothing)
|
||||
NativeMethods.CloseServiceHandle(sv_handle)
|
||||
'If Not test Then
|
||||
' Return False
|
||||
'End If
|
||||
NativeMethods.CloseServiceHandle(sc_handle)
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Shared Function TestConnection() As Boolean
|
||||
|
||||
Dim SC_MANAGER_CREATE_SERVICE As UInteger = &H2
|
||||
Dim SC_MANAGER_ALL_ACCESS As UInteger = &HF003F
|
||||
Dim SERVICE_WIN32_OWN_PROCESS As UInteger = &H10
|
||||
Dim SERVICE_ERROR_NORMAL As UInteger = &H1
|
||||
Dim STANDARD_RIGHTS_REQUIRED As UInteger = &HF0000
|
||||
Dim SERVICE_QUERY_CONFIG As UInteger = &H1
|
||||
Dim SERVICE_CHANGE_CONFIG As UInteger = &H2
|
||||
Dim SERVICE_QUERY_STATUS As UInteger = &H4
|
||||
Dim SERVICE_ENUMERATE_DEPENDENTS As UInteger = &H8
|
||||
Dim SERVICE_START As UInteger = &H10
|
||||
Dim SERVICE_STOP As UInteger = &H20
|
||||
Dim SERVICE_PAUSE_CONTINUE As UInteger = &H40
|
||||
Dim SERVICE_INTERROGATE As UInteger = &H80
|
||||
Dim SERVICE_USER_DEFINED_CONTROL As UInteger = &H100
|
||||
Dim SERVICE_ALL_ACCESS As UInteger = (STANDARD_RIGHTS_REQUIRED Or SERVICE_QUERY_CONFIG Or SERVICE_CHANGE_CONFIG Or SERVICE_QUERY_STATUS Or SERVICE_ENUMERATE_DEPENDENTS Or SERVICE_START Or SERVICE_STOP Or SERVICE_PAUSE_CONTINUE Or SERVICE_INTERROGATE Or SERVICE_USER_DEFINED_CONTROL)
|
||||
Dim SERVICE_AUTO_START As UInteger = &H2
|
||||
Dim sc_handle As IntPtr = NativeMethods.OpenSCManager(Nothing, Nothing, SC_MANAGER_ALL_ACCESS)
|
||||
|
||||
If Not sc_handle.Equals(IntPtr.Zero) Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function ChangeServiceParameters(svcPath As String, svcName As String, svcDispName As String, lpDependencies As String, User As String, Password As String) As Boolean
|
||||
Dim SC_MANAGER_CREATE_SERVICE As UInteger = &H2
|
||||
Dim SC_MANAGER_ALL_ACCESS As UInteger = &HF003F
|
||||
Dim SERVICE_WIN32_OWN_PROCESS As UInteger = &H10
|
||||
Dim SERVICE_ERROR_NORMAL As UInteger = &H1
|
||||
Dim STANDARD_RIGHTS_REQUIRED As UInteger = &HF0000
|
||||
Dim SERVICE_QUERY_CONFIG As UInteger = &H1
|
||||
Dim SERVICE_CHANGE_CONFIG As UInteger = &H2
|
||||
Dim SERVICE_QUERY_STATUS As UInteger = &H4
|
||||
Dim SERVICE_ENUMERATE_DEPENDENTS As UInteger = &H8
|
||||
Dim SERVICE_START As UInteger = &H10
|
||||
Dim SERVICE_STOP As UInteger = &H20
|
||||
Dim SERVICE_PAUSE_CONTINUE As UInteger = &H40
|
||||
Dim SERVICE_INTERROGATE As UInteger = &H80
|
||||
Dim SERVICE_USER_DEFINED_CONTROL As UInteger = &H100
|
||||
Dim SERVICE_ALL_ACCESS As UInteger = (STANDARD_RIGHTS_REQUIRED Or SERVICE_QUERY_CONFIG Or SERVICE_CHANGE_CONFIG Or SERVICE_QUERY_STATUS Or SERVICE_ENUMERATE_DEPENDENTS Or SERVICE_START Or SERVICE_STOP Or SERVICE_PAUSE_CONTINUE Or SERVICE_INTERROGATE Or SERVICE_USER_DEFINED_CONTROL)
|
||||
Dim SERVICE_AUTO_START As UInteger = &H2
|
||||
|
||||
|
||||
Dim GENERIC_WRITE As UInteger = &H40000000
|
||||
Dim sc_hndl As IntPtr = NativeMethods.OpenSCManager(Nothing, Nothing, GENERIC_WRITE)
|
||||
If sc_hndl.ToInt32() <> 0 Then
|
||||
Dim svc_hndl As IntPtr = NativeMethods.OpenService(sc_hndl, svcName, SC_MANAGER_ALL_ACCESS)
|
||||
If svc_hndl.ToInt32() <> 0 Then
|
||||
|
||||
Dim i As Integer = NativeMethods.ChangeServiceConfig(svc_hndl, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, _
|
||||
SERVICE_ERROR_NORMAL, svcPath, Nothing, 0, lpDependencies, User, IIf(Password = "", Nothing, Password), svcDispName)
|
||||
''ErrorCode = i
|
||||
NativeMethods.CloseServiceHandle(svc_hndl)
|
||||
If i <> 0 Then
|
||||
NativeMethods.CloseServiceHandle(sc_hndl)
|
||||
Return True
|
||||
Else
|
||||
NativeMethods.CloseServiceHandle(sc_hndl)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
|
||||
End Function
|
||||
Public Shared Function UninstallService(svcName As String) As Boolean
|
||||
Dim GENERIC_WRITE As UInteger = &H40000000
|
||||
Dim sc_hndl As IntPtr = NativeMethods.OpenSCManager(Nothing, Nothing, GENERIC_WRITE)
|
||||
If sc_hndl.ToInt32() <> 0 Then
|
||||
Dim DELETE As Integer = &H10000
|
||||
Dim svc_hndl As IntPtr = NativeMethods.OpenService(sc_hndl, svcName, DELETE)
|
||||
If svc_hndl.ToInt32() <> 0 Then
|
||||
Dim i As Integer = NativeMethods.DeleteService(svc_hndl)
|
||||
NativeMethods.CloseServiceHandle(svc_hndl)
|
||||
If i <> 0 Then
|
||||
NativeMethods.CloseServiceHandle(sc_hndl)
|
||||
Return True
|
||||
Else
|
||||
NativeMethods.CloseServiceHandle(sc_hndl)
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Shared Function GetErrorDescription(ErrorNumber As Integer) As String
|
||||
|
||||
Dim Desc = ""
|
||||
|
||||
'If Procedure = "DeleteService" Then ' OpenService OpenSCManager ChangeServiceConfig CreateService
|
||||
|
||||
'End If
|
||||
|
||||
If ErrorNumber = 5 Then
|
||||
'ERROR_ACCESS_DENIED
|
||||
Desc = "The handle does not have access to the service."
|
||||
ElseIf ErrorNumber = 1059 Then
|
||||
'ERROR_CIRCULAR_DEPENDENCY
|
||||
Desc = "A circular service dependency was specified."
|
||||
ElseIf ErrorNumber = 1065 Then
|
||||
'ERROR_DATABASE_DOES_NOT_EXIST
|
||||
Desc = "The specified database does not exist."
|
||||
ElseIf ErrorNumber = 1078 Then
|
||||
'ERROR_DUPLICATE_SERVICE_NAME
|
||||
Desc = "The display name already exists in the service control manager database either as a service name or as another display name."
|
||||
ElseIf ErrorNumber = 6 Then
|
||||
'ERROR_INVALID_HANDLE ---------------
|
||||
Desc = "The handle to the specified service control manager database is invalid."
|
||||
ElseIf ErrorNumber = 123 Then
|
||||
'ERROR_INVALID_NAME
|
||||
Desc = "The specified service name is invalid."
|
||||
ElseIf ErrorNumber = 87 Then
|
||||
'ERROR_INVALID_PARAMETER
|
||||
Desc = "A parameter that was specified is invalid."
|
||||
ElseIf ErrorNumber = 1057 Then
|
||||
'ERROR_INVALID_SERVICE_ACCOUNT
|
||||
Desc = "The account name does not exist, or a service is specified to share the same binary file as an already installed service but with an account name that is not the same as the installed service."
|
||||
ElseIf ErrorNumber = 1060 Then
|
||||
'ERROR_SERVICE_DOES_NOT_EXIST
|
||||
Desc = "The specified service does not exist."
|
||||
ElseIf ErrorNumber = 1072 Then
|
||||
'ERROR_SERVICE_MARKED_FOR_DELETE
|
||||
Desc = "The service has been marked for deletion."
|
||||
ElseIf ErrorNumber = 1073 Then
|
||||
'ERROR_SERVICE_EXISTS
|
||||
Desc = "The specified service already exists in this database."
|
||||
End If
|
||||
|
||||
GetErrorDescription = "№ " + ErrorNumber.ToString + " - " + Desc
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>
|
||||
</SchemaVersion>
|
||||
<ProjectGuid>{593952E2-6C95-4496-BFD5-C8C64DF78DE5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Installer</RootNamespace>
|
||||
<AssemblyName>Installer</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>Installer.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>Installer.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
13
Installer/My Project/Application.Designer.vb
generated
13
Installer/My Project/Application.Designer.vb
generated
@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
@ -1,35 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Общие сведения об этой сборке предоставляются следующим набором
|
||||
' атрибутов. Отредактируйте значения этих атрибутов, чтобы изменить
|
||||
' общие сведения об этой сборке.
|
||||
|
||||
' Проверьте значения атрибутов сборки
|
||||
|
||||
<Assembly: AssemblyTitle("Installer")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("Installer")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2013")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
<Assembly: Guid("7c4d2059-209b-4ff2-a762-597578e731ef")>
|
||||
|
||||
' Сведения о версии сборки состоят из следующих четырех значений:
|
||||
'
|
||||
' Основной номер версии
|
||||
' Дополнительный номер версии
|
||||
' Номер построения
|
||||
' Редакция
|
||||
'
|
||||
' Можно задать все значения или принять номер построения и номер редакции по умолчанию,
|
||||
' используя "*", как показано ниже:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
63
Installer/My Project/Resources.Designer.vb
generated
63
Installer/My Project/Resources.Designer.vb
generated
@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Installer.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
73
Installer/My Project/Settings.Designer.vb
generated
73
Installer/My Project/Settings.Designer.vb
generated
@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.Installer.My.MySettings
|
||||
Get
|
||||
Return Global.Installer.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
191
Parser/Class1.vb
191
Parser/Class1.vb
@ -1,191 +0,0 @@
|
||||
Namespace ParserServices
|
||||
|
||||
Public Class ParsesClass
|
||||
|
||||
Public Shared Function ParseString(Text As String)
|
||||
|
||||
Dim Array(0)
|
||||
|
||||
If Not Text = "" Then
|
||||
|
||||
Dim RowArr(2)
|
||||
|
||||
Dim j = 0
|
||||
Dim OpenBlock = False
|
||||
Dim Level = 0
|
||||
|
||||
For i = 0 To Text.Length - 1
|
||||
|
||||
Dim Simb = Text.Substring(i, 1)
|
||||
Dim SubStr = ""
|
||||
|
||||
If OpenBlock Then
|
||||
If Simb = """" Then
|
||||
OpenBlock = False
|
||||
End If
|
||||
Else
|
||||
If Simb = "{" Then
|
||||
Level = Level + 1
|
||||
SubStr = "НачалоУровня"
|
||||
ElseIf Simb = "}" Then
|
||||
Level = Level - 1
|
||||
SubStr = "ОкончаниеУровня"
|
||||
ElseIf Simb = """" Then
|
||||
OpenBlock = True
|
||||
ElseIf Simb = "," Then
|
||||
SubStr = "Разделитель"
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not SubStr = "" Then
|
||||
ReDim Preserve Array(j)
|
||||
ReDim RowArr(2)
|
||||
RowArr(0) = i
|
||||
RowArr(1) = SubStr
|
||||
RowArr(2) = Level
|
||||
|
||||
Array(j) = RowArr
|
||||
j = j + 1
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
Dim ArrayBases(0)
|
||||
Dim ArrayRow(2)
|
||||
Dim ArrayLines(0)
|
||||
|
||||
If Array.Length > 1 Then
|
||||
|
||||
Dim ArrayLevel(10) As Integer
|
||||
Dim ArrayValue(0)
|
||||
|
||||
Dim Level = 0
|
||||
' Dim CountLines = 0
|
||||
Dim LastVal = 0
|
||||
Dim StrLevel = ""
|
||||
|
||||
For Each a In Array
|
||||
|
||||
Select Case a(1)
|
||||
Case "НачалоУровня"
|
||||
|
||||
If Not StrLevel = "" Then
|
||||
ArrayValue(0) = StrLevel
|
||||
ArrayLines(ArrayLines.Length - 1) = ArrayValue
|
||||
ReDim Preserve ArrayLines(ArrayLines.Length)
|
||||
End If
|
||||
|
||||
|
||||
' CountLines = CountLines + 1
|
||||
ArrayLevel(Level) = ArrayLevel(Level) + 1
|
||||
Level = Level + 1
|
||||
|
||||
StrLevel = ""
|
||||
For j = 0 To Level - 1
|
||||
StrLevel = IIf(StrLevel = "", "", StrLevel + ".") + ArrayLevel(j).ToString
|
||||
Next
|
||||
|
||||
ReDim ArrayValue(0)
|
||||
|
||||
Case "ОкончаниеУровня"
|
||||
|
||||
Dim TextStr = Text.Substring(LastVal + 1, a(0) - LastVal - 1)
|
||||
TextStr = TextStr.Replace("""""", """")
|
||||
If TextStr = """" Then TextStr = ""
|
||||
|
||||
If TextStr.StartsWith("""") And TextStr.EndsWith("""") Then
|
||||
TextStr = TextStr.Substring(1, TextStr.Length - 2)
|
||||
End If
|
||||
'If Not TextStr = "" Then
|
||||
ReDim Preserve ArrayValue(ArrayValue.Length)
|
||||
ArrayValue(ArrayValue.Length - 1) = TextStr
|
||||
'End If
|
||||
|
||||
|
||||
ArrayValue(0) = StrLevel
|
||||
ArrayLines(ArrayLines.Length - 1) = ArrayValue
|
||||
ReDim Preserve ArrayLines(ArrayLines.Length)
|
||||
|
||||
'ArrayLevel(Level) = ArrayLevel(Level) - 1
|
||||
ArrayLevel(Level) = 0
|
||||
Level = Level - 1
|
||||
|
||||
ReDim ArrayValue(0)
|
||||
|
||||
StrLevel = ""
|
||||
For j = 0 To Level - 1
|
||||
StrLevel = IIf(StrLevel = "", "", StrLevel + ".") + ArrayLevel(j).ToString
|
||||
Next
|
||||
|
||||
|
||||
Case "Разделитель"
|
||||
|
||||
Dim TextStr = Text.Substring(LastVal + 1, a(0) - LastVal - 1)
|
||||
TextStr = TextStr.Replace("""""", """")
|
||||
If TextStr = """" Then TextStr = ""
|
||||
|
||||
If TextStr.StartsWith("""") And TextStr.EndsWith("""") Then
|
||||
TextStr = TextStr.Substring(1, TextStr.Length - 2)
|
||||
End If
|
||||
|
||||
'If Not TextStr = "" Then
|
||||
ReDim Preserve ArrayValue(ArrayValue.Length)
|
||||
ArrayValue(ArrayValue.Length - 1) = TextStr
|
||||
'End If
|
||||
|
||||
End Select
|
||||
|
||||
LastVal = a(0)
|
||||
|
||||
Next
|
||||
End If
|
||||
|
||||
Return ArrayLines
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function ParseEventlogString(Text As String)
|
||||
|
||||
Dim ArrayLines(0)
|
||||
|
||||
Dim Text2 = Text.Substring(1, IIf(Text.EndsWith(","), Text.Length - 3, Text.Length - 2)) + ","
|
||||
|
||||
Dim Str = ""
|
||||
|
||||
Dim Delim = Text2.IndexOf(",")
|
||||
Dim i = 0
|
||||
|
||||
While Delim > 0
|
||||
Str = Str + Text2.Substring(0, Delim)
|
||||
Text2 = Text2.Substring(Delim + 1)
|
||||
|
||||
If CountSubstringInString(Str, "{") = CountSubstringInString(Str, "}") _
|
||||
And Math.IEEERemainder(CountSubstringInString(Str, """"), 2) = 0 Then
|
||||
|
||||
ReDim Preserve ArrayLines(i)
|
||||
ArrayLines(i) = Str.Trim
|
||||
i = i + 1
|
||||
Str = ""
|
||||
Else
|
||||
Str = Str + ","
|
||||
End If
|
||||
|
||||
Delim = Text2.IndexOf(",")
|
||||
|
||||
End While
|
||||
|
||||
Return ArrayLines
|
||||
|
||||
End Function
|
||||
|
||||
Shared Function CountSubstringInString(Str As String, SubStr As String)
|
||||
|
||||
CountSubstringInString = (Str.Length - Str.Replace(SubStr, "").Length) / SubStr.Length
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
13
Parser/My Project/Application.Designer.vb
generated
13
Parser/My Project/Application.Designer.vb
generated
@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
@ -1,35 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Общие сведения об этой сборке предоставляются следующим набором
|
||||
' атрибутов. Отредактируйте значения этих атрибутов, чтобы изменить
|
||||
' общие сведения об этой сборке.
|
||||
|
||||
' Проверьте значения атрибутов сборки
|
||||
|
||||
<Assembly: AssemblyTitle("Parser")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("Parser")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2013")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
<Assembly: Guid("025b759e-d7dd-4524-957a-c14b44b6dbcc")>
|
||||
|
||||
' Сведения о версии сборки состоят из следующих четырех значений:
|
||||
'
|
||||
' Основной номер версии
|
||||
' Дополнительный номер версии
|
||||
' Номер построения
|
||||
' Редакция
|
||||
'
|
||||
' Можно задать все значения или принять номер построения и номер редакции по умолчанию,
|
||||
' используя "*", как показано ниже:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
63
Parser/My Project/Resources.Designer.vb
generated
63
Parser/My Project/Resources.Designer.vb
generated
@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Parser.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
73
Parser/My Project/Settings.Designer.vb
generated
73
Parser/My Project/Settings.Designer.vb
generated
@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.Parser.My.MySettings
|
||||
Get
|
||||
Return Global.Parser.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>
|
||||
</SchemaVersion>
|
||||
<ProjectGuid>{3164BFA8-8AC5-4BC2-965A-15D40B6316AA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Parser</RootNamespace>
|
||||
<AssemblyName>Parser</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>Parser.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>Parser.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@ -1,248 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports EventLogLoaderService
|
||||
|
||||
Public Class ServiceDescriptionClass
|
||||
Public Name As String
|
||||
Public DisplayName As String
|
||||
Public Description As String
|
||||
Public PathName As String
|
||||
Public User As String
|
||||
|
||||
Public Debug As Boolean = False
|
||||
Public ExeFile As String = ""
|
||||
Public ClusterFiles As String = ""
|
||||
Public PortAgent As Integer = 1540
|
||||
Public PortMngr As Integer = 1541
|
||||
Public PortProcessBegin As Integer = 1560
|
||||
Public PortProcessEnd As Integer = 1591
|
||||
|
||||
Public Structure Infobases
|
||||
Dim Name As String
|
||||
Dim Description As String
|
||||
Dim GUID As String
|
||||
Dim SizeEventLog As Integer
|
||||
Dim CatalogEventLog As String
|
||||
End Structure
|
||||
|
||||
Public ArrayInfobases() As Infobases
|
||||
|
||||
Sub ParsePath()
|
||||
|
||||
Dim PathNameTemp = PathName.ToLower
|
||||
|
||||
If PathNameTemp.Contains("-debug") _
|
||||
Or PathNameTemp.Contains("/debug") Then
|
||||
|
||||
Debug = True
|
||||
|
||||
PathNameTemp = PathNameTemp.Replace("-debug", "")
|
||||
PathNameTemp = PathNameTemp.Replace("/debug", "")
|
||||
|
||||
End If
|
||||
|
||||
Dim Ind = PathNameTemp.IndexOf("ragent.exe")
|
||||
If Ind > 0 Then
|
||||
ExeFile = PathNameTemp.Substring(0, Ind + 10)
|
||||
ExeFile = ExeFile.Replace("""", "")
|
||||
|
||||
PathNameTemp = PathNameTemp.Substring(Ind + 11)
|
||||
End If
|
||||
|
||||
Ind = PathNameTemp.IndexOf("-regport")
|
||||
If Ind > 0 Then
|
||||
|
||||
Dim PortStr = ""
|
||||
Dim i = 0
|
||||
Dim Simb = PathNameTemp.Substring(Ind + 8 + i, 1)
|
||||
|
||||
While "0123456789 ".Contains(Simb)
|
||||
|
||||
PortStr = PortStr + Simb
|
||||
i = i + 1
|
||||
Simb = PathNameTemp.Substring(Ind + 8 + i, 1)
|
||||
|
||||
End While
|
||||
|
||||
Try
|
||||
PortMngr = Convert.ToInt32(PortStr)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
Ind = PathNameTemp.IndexOf("-port")
|
||||
If Ind > 0 Then
|
||||
|
||||
Dim PortStr = ""
|
||||
Dim i = 0
|
||||
Dim Simb = PathNameTemp.Substring(Ind + 5 + i, 1)
|
||||
|
||||
While "0123456789 ".Contains(Simb)
|
||||
|
||||
PortStr = PortStr + Simb
|
||||
i = i + 1
|
||||
Simb = PathNameTemp.Substring(Ind + 5 + i, 1)
|
||||
|
||||
End While
|
||||
|
||||
Try
|
||||
PortAgent = Convert.ToInt32(PortStr)
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
Ind = PathNameTemp.IndexOf("-range")
|
||||
If Ind > 0 Then
|
||||
|
||||
Dim PortStr = ""
|
||||
Dim i = 0
|
||||
Dim Simb = PathNameTemp.Substring(Ind + 6 + i, 1)
|
||||
|
||||
While "0123456789 :".Contains(Simb)
|
||||
|
||||
PortStr = PortStr + Simb
|
||||
i = i + 1
|
||||
Simb = PathNameTemp.Substring(Ind + 6 + i, 1)
|
||||
|
||||
End While
|
||||
|
||||
Try
|
||||
|
||||
Ind = PortStr.IndexOf(":")
|
||||
PortProcessBegin = Convert.ToInt32(PortStr.Substring(0, Ind))
|
||||
PortProcessEnd = Convert.ToInt32(PortStr.Substring(Ind + 1))
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
Ind = PathNameTemp.IndexOf("-d")
|
||||
If Ind > 0 Then
|
||||
|
||||
Dim PathStr = PathNameTemp.Substring(Ind + 2)
|
||||
Dim Simb = PathStr.Substring(0, 1)
|
||||
|
||||
While " """.Contains(Simb)
|
||||
|
||||
PathStr = PathStr.Substring(2)
|
||||
Simb = PathStr.Substring(1, 1)
|
||||
|
||||
End While
|
||||
|
||||
Ind = PathStr.IndexOf("""")
|
||||
If Ind > 0 Then
|
||||
ClusterFiles = PathStr.Substring(0, Ind)
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
'А теперь финт ушами - ищем полученные строки в иходной строке и вырезаем оттуда с корректным регистром
|
||||
Ind = PathName.ToLower.IndexOf(ExeFile)
|
||||
If Ind > 0 Then
|
||||
ExeFile = PathName.Substring(Ind, ExeFile.Length)
|
||||
End If
|
||||
|
||||
Ind = PathName.ToLower.IndexOf(ClusterFiles)
|
||||
If Ind > 0 Then
|
||||
ClusterFiles = PathName.Substring(Ind, ClusterFiles.Length)
|
||||
End If
|
||||
|
||||
'"C:\Program Files\1cv82\8.2.17.153\bin\ragent.exe" -debug -srvc -agent
|
||||
'-regport 2541 -port 2540 -range 2560:2591 -d "C:\Program Files\1cv82\srvinfo"
|
||||
|
||||
End Sub
|
||||
|
||||
Sub GetInfobases()
|
||||
|
||||
Try
|
||||
Dim Catalog = Path.Combine(ClusterFiles, "reg_" + PortMngr.ToString)
|
||||
|
||||
Dim TMP = My.Computer.FileSystem.GetTempFileName()
|
||||
|
||||
'8.2
|
||||
Dim ConfFilePath As String = Path.Combine(Catalog, "1CV8Reg.lst")
|
||||
If My.Computer.FileSystem.FileExists(ConfFilePath) Then
|
||||
My.Computer.FileSystem.CopyFile(ConfFilePath, TMP, True)
|
||||
|
||||
End If
|
||||
|
||||
'8.3
|
||||
ConfFilePath = Path.Combine(Catalog, "1CV8Clst.lst")
|
||||
If My.Computer.FileSystem.FileExists(ConfFilePath) Then
|
||||
My.Computer.FileSystem.CopyFile(ConfFilePath, TMP, True)
|
||||
End If
|
||||
|
||||
Dim Text = My.Computer.FileSystem.ReadAllText(TMP)
|
||||
My.Computer.FileSystem.DeleteFile(TMP)
|
||||
|
||||
Dim Array = ParserServices.ParseString(Text)
|
||||
|
||||
Dim i = 0
|
||||
|
||||
For Each a In Array
|
||||
If Not a Is Nothing Then
|
||||
If a.Length = 11 And a(0).StartsWith("1.2.") Then
|
||||
|
||||
Dim IB = New Infobases
|
||||
IB.Name = a(2).ToString
|
||||
IB.GUID = a(1).ToString
|
||||
IB.Description = a(3).ToString
|
||||
IB.SizeEventLog = 0
|
||||
|
||||
Try
|
||||
|
||||
Dim SizeLog As UInt64 = 0
|
||||
Dim CatalogEventLog = Path.Combine(Path.Combine(Catalog, IB.GUID), "1Cv8Log\")
|
||||
|
||||
IB.CatalogEventLog = CatalogEventLog
|
||||
|
||||
If My.Computer.FileSystem.DirectoryExists(CatalogEventLog) Then
|
||||
|
||||
|
||||
|
||||
For Each File In My.Computer.FileSystem.GetFiles(CatalogEventLog)
|
||||
Dim FI = My.Computer.FileSystem.GetFileInfo(File)
|
||||
SizeLog = SizeLog + FI.Length
|
||||
Next
|
||||
|
||||
IB.SizeEventLog = Math.Round(SizeLog / 1024 / 1024, 2)
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
ReDim Preserve ArrayInfobases(i)
|
||||
ArrayInfobases(i) = IB
|
||||
|
||||
i = i + 1
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
System.Array.Sort(ArrayInfobases)
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
13
Service1C/My Project/Application.Designer.vb
generated
13
Service1C/My Project/Application.Designer.vb
generated
@ -1,13 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>false</MySubMain>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>1</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
@ -1,35 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Общие сведения об этой сборке предоставляются следующим набором
|
||||
' атрибутов. Отредактируйте значения этих атрибутов, чтобы изменить
|
||||
' общие сведения об этой сборке.
|
||||
|
||||
' Проверьте значения атрибутов сборки
|
||||
|
||||
<Assembly: AssemblyTitle("Service1C")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("Service1C")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2013")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
<Assembly: Guid("a5928e4f-33db-4280-9082-ed138f746ea1")>
|
||||
|
||||
' Сведения о версии сборки состоят из следующих четырех значений:
|
||||
'
|
||||
' Основной номер версии
|
||||
' Дополнительный номер версии
|
||||
' Номер построения
|
||||
' Редакция
|
||||
'
|
||||
' Можно задать все значения или принять номер построения и номер редакции по умолчанию,
|
||||
' используя "*", как показано ниже:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
63
Service1C/My Project/Resources.Designer.vb
generated
63
Service1C/My Project/Resources.Designer.vb
generated
@ -1,63 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Service1C.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
73
Service1C/My Project/Settings.Designer.vb
generated
73
Service1C/My Project/Settings.Designer.vb
generated
@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.Service1C.My.MySettings
|
||||
Get
|
||||
Return Global.Service1C.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>
|
||||
</SchemaVersion>
|
||||
<ProjectGuid>{7261F9CC-9B2F-4FA5-ADD3-9FCF4948623F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Service1C</RootNamespace>
|
||||
<AssemblyName>Service1C</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>Service1C.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>Service1C.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EventLogLoaderService\EventLogLoaderService.vbproj">
|
||||
<Project>{F7EF5930-B310-4697-B522-2325EAF247F2}</Project>
|
||||
<Name>EventLogLoaderService</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user