initial commit
This commit is contained in:
37
ArinWarev1/Module/CForm.Designer.vb
generated
Normal file
37
ArinWarev1/Module/CForm.Designer.vb
generated
Normal file
@@ -0,0 +1,37 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class CForm
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows Form 디자이너에 필요합니다.
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다.
|
||||
'수정하려면 Windows Form 디자이너를 사용하십시오.
|
||||
'코드 편집기를 사용하여 수정하지 마십시오.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'CForm
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(525, 326)
|
||||
Me.Name = "CForm"
|
||||
Me.Text = "Base Data Form"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
120
ArinWarev1/Module/CForm.resx
Normal file
120
ArinWarev1/Module/CForm.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<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" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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>
|
||||
21
ArinWarev1/Module/CForm.vb
Normal file
21
ArinWarev1/Module/CForm.vb
Normal file
@@ -0,0 +1,21 @@
|
||||
Public Class CForm
|
||||
|
||||
Public Parameter As String = "" '//트리노드로부터들어오는 화면파라미터
|
||||
Public TreeTag As String = "" '//트리노드의 태그값
|
||||
Public OpenTime As String = ""
|
||||
|
||||
Public Overridable Function AcceptChanged() As Boolean
|
||||
Return True
|
||||
End Function
|
||||
Public Overridable Function RejectChanged() As Boolean
|
||||
Return True
|
||||
End Function
|
||||
Public Overridable Function HasChanged() As Boolean
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Overridable Sub AddDebug(m As String)
|
||||
Debug.WriteLine(String.Format("{3}({0})-[{1}] {2}", OpenTime, Now.ToString("HH:mm:ss"), m, Me.Name))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
7
ArinWarev1/Module/CLang.vb
Normal file
7
ArinWarev1/Module/CLang.vb
Normal file
@@ -0,0 +1,7 @@
|
||||
Public Class CLang
|
||||
' Public Const 미지원UI버젼 As String = "현재파일의 UI Version 은 지원되지 않습니다."
|
||||
Public Const 열린파일없음 As String = "열려있는 템플릿이 없습니다"
|
||||
Public Const 종료할래 As String = "종료하시겠습니까?"
|
||||
Public Const 미지원LG버젼 As String = "현재파일의 LG Version 은 지원되지 않습니다."
|
||||
Public Const 확인 As String = "확인"
|
||||
End Class
|
||||
17
ArinWarev1/Module/CMenu.vb
Normal file
17
ArinWarev1/Module/CMenu.vb
Normal file
@@ -0,0 +1,17 @@
|
||||
Public Class CMenu
|
||||
|
||||
Private _name As String = ""
|
||||
Public Sub New(p_name As String)
|
||||
_name = p_name
|
||||
End Sub
|
||||
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return _name
|
||||
End Get
|
||||
Set(value As String)
|
||||
_name = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
End Class
|
||||
14
ArinWarev1/Module/Enum.vb
Normal file
14
ArinWarev1/Module/Enum.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Module EnumMod
|
||||
Enum E_Level
|
||||
hide = 0
|
||||
Normal = 10
|
||||
Admin = 20
|
||||
Developer = 30
|
||||
End Enum
|
||||
Enum E_VerType
|
||||
Basic = 0
|
||||
Pro = 10
|
||||
Full = 20
|
||||
Dev = 30
|
||||
End Enum
|
||||
End Module
|
||||
760
ArinWarev1/Module/Pub.vb
Normal file
760
ArinWarev1/Module/Pub.vb
Normal file
@@ -0,0 +1,760 @@
|
||||
Module Pub
|
||||
|
||||
Structure s_Project
|
||||
Dim FileName As String
|
||||
Dim MakeTime As String
|
||||
Dim Desc As String
|
||||
Dim Opened As Boolean
|
||||
Dim UIVersion As String
|
||||
Dim LGVersino As String
|
||||
Dim Name As String
|
||||
Dim MaxUI As String
|
||||
Dim MaxLG As String
|
||||
Dim SFType As String '//저장파일 형태
|
||||
Dim EditTime As String
|
||||
Dim Admin As Boolean '//현재프로그램이 관리자 모드인가?
|
||||
Dim Password As String '//해당프로젝트가 엄호로 보호되어있는가?
|
||||
Dim IsError As Boolean '//로드시 에러가 발생하였는가?
|
||||
Dim CUrIP As String
|
||||
Dim CUrMac As String
|
||||
Dim LoginTime As String '//로그인시간
|
||||
Dim UserId As String
|
||||
Dim UserName As String
|
||||
Dim UserPass As String
|
||||
Dim UserIp As String
|
||||
Dim UserMac As String
|
||||
Dim UserAuthType As String
|
||||
End Structure
|
||||
|
||||
Public pLog As ArinLog.ArinLog
|
||||
|
||||
Public Prj As New s_Project : Public StartVersion As String = "2010032000"
|
||||
Public Myini As CEnergy.MyINI
|
||||
Public PrjChanged As Boolean = False
|
||||
|
||||
' Public Uselov As Lov.ModLov
|
||||
Public PreFile(4) As String
|
||||
Public msgf As Frm_Work = Nothing '201130830
|
||||
|
||||
Public DSET1 As New DS '//일반데이터
|
||||
Public DSET2 As New DS '//일반데이터(임시)
|
||||
Public DSETR1 As New DSR '//결과데이터(결과)
|
||||
Public DSETR2 As New DSR '//결과데이터(임시)
|
||||
Public DataDir As New System.IO.DirectoryInfo(My.Application.Info.DirectoryPath)
|
||||
Public TemplateDir As New System.IO.DirectoryInfo(DataDir.FullName & "\template")
|
||||
|
||||
Public Calc As Calculator '//계산로직이다.파일열릴떄 할당됨
|
||||
Public Result1 As New CResult(DSET1, DSETR1) '//기본데이터결과
|
||||
Public Result2 As New CResult(DSET2, DSETR2) '//설계개선용데이터결과
|
||||
Public LogSB As System.Text.StringBuilder
|
||||
|
||||
Public EnDec As New ArinLogin.EnDec("tindevil.com")
|
||||
|
||||
Public DSHistory As New DS2
|
||||
|
||||
Public Function CurrentUIVersion() As String
|
||||
Dim uiverstr As String = My.Application.Info.Version.Minor.ToString("0000") + _
|
||||
My.Application.Info.Version.Build.ToString("0000") + _
|
||||
My.Application.Info.Version.Revision.ToString("0000").Substring(0, 2)
|
||||
Return uiverstr
|
||||
End Function
|
||||
|
||||
Public Sub NOTICE(ByVal MSG As String, ByVal Src As Windows.Forms.ToolStripStatusLabel, ByVal FCOLOR As Drawing.Color)
|
||||
If Not Src Is Nothing Then
|
||||
Src.Text = "▶ " & MSG & Space(1) & "[" & Format(Now, "HH시mm분ss초") & "]"
|
||||
Src.ForeColor = FCOLOR
|
||||
End If
|
||||
If FCOLOR = Drawing.Color.Red Then My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Beep)
|
||||
End Sub
|
||||
|
||||
Public Sub MsgboxE(msg As String, Optional SaveLog As Boolean = False)
|
||||
MsgBox(msg, MsgBoxStyle.Critical, "확인")
|
||||
If SaveLog Then
|
||||
pLog.Add(msg, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub MsgboxI(msg As String, Optional SaveLog As Boolean = False)
|
||||
MsgBox(msg, MsgBoxStyle.Information, "확인")
|
||||
If SaveLog Then
|
||||
pLog.Add(msg, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 모든입력면의 창,문의 면적비를 계산하여 반환한다(frm_myoun의 Display_info 함수에서 가져옴)
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function calc_창및문면적비(ByRef 면적비 As Decimal, ByRef 열관류율 As Decimal, Optional 방위 As String = "") As Boolean
|
||||
면적비 = 0
|
||||
열관류율 = 0
|
||||
|
||||
Dim filter As String = "code <> '0' and (건축부위방식='외벽' or 건축부위방식 ='외부창' or 건축부위방식='내벽' or 건축부위방식 ='내부창')"
|
||||
If 방위 <> "" Then filter += " and 방위='" + 방위 + "'"
|
||||
|
||||
Dim 면데이터() As DS.tbl_myounRow = DSET1.tbl_myoun.Select(filter)
|
||||
|
||||
Dim WindowArea As Decimal = 0
|
||||
Dim WallArea As Decimal = 0
|
||||
Dim 열관류율합 As Double = 0
|
||||
|
||||
For Each Dr입력면 As DS.tbl_myounRow In 면데이터
|
||||
Dim 존수 As Integer = 1
|
||||
Dim 열관 As Single = 0
|
||||
|
||||
'If Dr입력면.열관류율2 = "0" Then Continue For '//열관류율이 연결되어 있어야한다
|
||||
|
||||
Dim Dryk() As DS.tbl_ykRow = Nothing
|
||||
If Dr입력면.열관류율2 <> "0" Then
|
||||
Dryk = DSET1.tbl_yk.Select("code='" & Dr입력면.열관류율2 & "'")
|
||||
If Dryk.Length < 1 Then
|
||||
MsgBox("입력면(" + Dr입력면.설명 + ")의 열관류율 연결값이 열관류율표에 존재하지 않습니다(Code=" + Dr입력면.열관류율2 + ")", MsgBoxStyle.Critical, "확인")
|
||||
Continue For
|
||||
End If
|
||||
열관 = TOSG(Dryk(0).열관류율)
|
||||
Else
|
||||
열관 = TOSG(Dr입력면.열관류율)
|
||||
End If
|
||||
|
||||
'//이 입력면을 사용하는 존의 정보를 가져온다(오류가 있다면 존의갯수를 1로한다)
|
||||
Dim dr존() As DS.tbl_zoneRow = DSET1.tbl_zone.Select("code='" + Dr입력면.존분류 + "'")
|
||||
If dr존.Length > 0 Then
|
||||
If IsNumeric(dr존(0).입력존의수) Then 존수 = CInt(dr존(0).입력존의수)
|
||||
End If
|
||||
|
||||
|
||||
Select Case Dr입력면.건축부위방식
|
||||
Case "외벽"
|
||||
열관류율합 += 열관 * 1 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "내벽"
|
||||
열관류율합 += 열관 * 0.7 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "외부창"
|
||||
열관류율합 += 열관 * 1 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "내부창"
|
||||
열관류율합 += 열관 * 0.8 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
End Select
|
||||
|
||||
If Dryk Is Nothing Then
|
||||
'//열관류 선택안된경우
|
||||
Select Case Dr입력면.건축부위방식
|
||||
Case "외벽"
|
||||
If Dr입력면.방위 <> "수평" AndAlso Dr입력면.방위 <> "일사없음" AndAlso Dr입력면.방위 <> "(없음)" Then
|
||||
WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
End If
|
||||
Case "내벽" '
|
||||
WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "외부창"
|
||||
If Dr입력면.방위 <> "수평" AndAlso Dr입력면.방위 <> "일사없음" AndAlso Dr입력면.방위 <> "(없음)" Then
|
||||
WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
End If
|
||||
Case "내부창"
|
||||
WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
End Select
|
||||
Else
|
||||
|
||||
Dim 면형태이름 As String = Get_CName("1088", Dryk(0).면형태)
|
||||
Select Case 면형태이름
|
||||
Case "외벽(벽체)"
|
||||
WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "내벽(벽체)"
|
||||
WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "외부창"
|
||||
If Dr입력면.방위 <> "수평" AndAlso Dr입력면.방위 <> "일사없음" AndAlso Dr입력면.방위 <> "(없음)" Then
|
||||
WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
End If
|
||||
Case "내부창"
|
||||
WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
End Select
|
||||
End If
|
||||
|
||||
'Debug.WriteLine(Dr입력면.code + ":wall=" + WallArea.ToString() + ",win=" + WindowArea.ToString())
|
||||
Next
|
||||
|
||||
'//면적비계산
|
||||
Dim r As Decimal = 0
|
||||
If (WallArea + WindowArea) <> 0 Then
|
||||
r = WindowArea / (WallArea + WindowArea) * 100
|
||||
End If
|
||||
|
||||
면적비 = r
|
||||
|
||||
If WallArea + WindowArea = 0 Then
|
||||
열관류율 = (0.0F)
|
||||
Else
|
||||
열관류율 = 열관류율합 / (WallArea + WindowArea)
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 모든입력면의 창,문의 면적비를 계산하여 반환한다(frm_myoun의 Display_info 함수에서 가져옴)
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function calc_평균열관류율(건축부위방식() As String) As Decimal
|
||||
Dim filter As String = "code <> '0' and 열관류율2 <> '' and 열관류율2 <> '0'"
|
||||
'If 방위 <> "" Then filter += " and 방위='" + 방위 + "'"
|
||||
|
||||
'//해당방식을 사용한 열관류율을 모두 찾아서
|
||||
|
||||
Dim 면데이터() As DS.tbl_myounRow = DSET1.tbl_myoun.Select(filter)
|
||||
|
||||
Dim WindowArea As Decimal = 0
|
||||
Dim WallArea As Decimal = 0
|
||||
Dim 열관류율합 As Double = 0
|
||||
|
||||
For Each Dr입력면 As DS.tbl_myounRow In 면데이터
|
||||
|
||||
'//이 입력면의 건축부위방식(열관류율테이블)이 일치한다면 그 값을 상요하도록 한다
|
||||
Dim 열관데이터() As DS.tbl_ykRow = DSET1.tbl_yk.Select("code='" + Dr입력면.열관류율2 + "' and 면형태 <> '' and 면형태 <> '0'")
|
||||
If 열관데이터.Length < 1 Then Continue For
|
||||
|
||||
'//열관류율데이터의 형태가 건축부위방식과 맞는지 확인한다
|
||||
Dim 공용() As DS.tbl_commonRow = DSET1.tbl_common.Select("gubun = '1088' and code='" + 열관데이터(0).면형태 + "'")
|
||||
If 공용.Length < 1 Then Continue For
|
||||
|
||||
Dim 부위찾음 As Boolean = False
|
||||
For Each 찾을부위 As String In 건축부위방식
|
||||
If 공용(0).name = 찾을부위 Then 부위찾음 = True
|
||||
Next
|
||||
|
||||
If Not 부위찾음 Then Continue For
|
||||
|
||||
Dim 존수 As Integer = 1
|
||||
Dim 열관 As Single = 0
|
||||
|
||||
'If Dr입력면.열관류율2 = "0" Then Continue For '//열관류율이 연결되어 있어야한다
|
||||
|
||||
Dim Dryk() As DS.tbl_ykRow = Nothing
|
||||
If Dr입력면.열관류율2 <> "0" Then
|
||||
Dryk = DSET1.tbl_yk.Select("code='" & Dr입력면.열관류율2 & "'")
|
||||
If Dryk.Length < 1 Then
|
||||
MsgBox("입력면(" + Dr입력면.설명 + ")의 열관류율 연결값이 열관류율표에 존재하지 않습니다(Code=" + Dr입력면.열관류율2 + ")", MsgBoxStyle.Critical, "확인")
|
||||
Continue For
|
||||
End If
|
||||
열관 = TOSG(Dryk(0).열관류율)
|
||||
Else
|
||||
열관 = TOSG(Dr입력면.열관류율)
|
||||
End If
|
||||
|
||||
'//이 입력면을 사용하는 존의 정보를 가져온다(오류가 있다면 존의갯수를 1로한다)
|
||||
Dim dr존() As DS.tbl_zoneRow = DSET1.tbl_zone.Select("code='" + Dr입력면.존분류 + "'")
|
||||
If dr존.Length > 0 Then
|
||||
If IsNumeric(dr존(0).입력존의수) Then 존수 = CInt(dr존(0).입력존의수)
|
||||
End If
|
||||
|
||||
|
||||
Select Case Dr입력면.건축부위방식
|
||||
Case "외벽"
|
||||
열관류율합 += 열관 * 1 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "내벽"
|
||||
열관류율합 += 열관 * 0.7 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "외부창"
|
||||
열관류율합 += 열관 * 1 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
Case "내부창"
|
||||
열관류율합 += 열관 * 0.8 * TOSG(Dr입력면.건축부위면적) * 존수
|
||||
End Select
|
||||
|
||||
WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
|
||||
'If Dryk Is Nothing OrElse Dryk.Length < 1 Then
|
||||
' '//열관류 선택안된경우
|
||||
' Select Case Dr입력면.건축부위방식
|
||||
' Case "외벽"
|
||||
' If Dr입력면.방위 <> "수평" AndAlso Dr입력면.방위 <> "일사없음" AndAlso Dr입력면.방위 <> "(없음)" Then
|
||||
' WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' End If
|
||||
' Case "내벽" '
|
||||
' WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' Case "외부창"
|
||||
' If Dr입력면.방위 <> "수평" AndAlso Dr입력면.방위 <> "일사없음" AndAlso Dr입력면.방위 <> "(없음)" Then
|
||||
' WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' End If
|
||||
' Case "내부창"
|
||||
' WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' End Select
|
||||
'Else
|
||||
|
||||
' Dim 면형태이름 As String = Get_CName("1088", Dryk(0).면형태)
|
||||
' Select Case 면형태이름
|
||||
' Case "외벽(벽체)"
|
||||
' WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' 'Case "내벽(벽체)"
|
||||
' ' WallArea = WallArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' 'Case "외부창"
|
||||
' ' If Dr입력면.방위 <> "수평" AndAlso Dr입력면.방위 <> "일사없음" AndAlso Dr입력면.방위 <> "(없음)" Then
|
||||
' ' WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' ' End If
|
||||
' 'Case "내부창"
|
||||
' ' WindowArea = WindowArea + TOSG(Dr입력면.건축부위면적) * 존수
|
||||
' End Select
|
||||
'End If
|
||||
|
||||
'Debug.WriteLine(Dr입력면.code + ":wall=" + WallArea.ToString() + ",win=" + WindowArea.ToString())
|
||||
Next
|
||||
|
||||
'//면적비계산
|
||||
'Dim r As Decimal = 0
|
||||
'If (WallArea + WindowArea) <> 0 Then
|
||||
' r = WindowArea / (WallArea + WindowArea) * 100
|
||||
'End If
|
||||
|
||||
'면적비 = r
|
||||
|
||||
If WallArea + WindowArea = 0 Then
|
||||
Return (0.0F)
|
||||
Else
|
||||
Return 열관류율합 / (WallArea + WindowArea)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
Public Function getColCaption(ByVal dt As DataTable) As String()
|
||||
Dim Clist(dt.Columns.Count - 1) As String
|
||||
For i As Integer = 1 To dt.Columns.Count
|
||||
If dt.Columns(i - 1).Caption.ToString <> "" Then Clist(i - 1) = dt.Columns(i - 1).Caption.ToString
|
||||
Next
|
||||
Return Clist
|
||||
End Function
|
||||
|
||||
Public Function getColName(ByVal dt As DataTable) As String()
|
||||
Dim Clist(dt.Columns.Count - 1) As String
|
||||
For i As Integer = 1 To dt.Columns.Count
|
||||
If dt.Columns(i - 1).ColumnName.ToString <> "" Then Clist(i - 1) = dt.Columns(i - 1).ColumnName.ToString
|
||||
Next
|
||||
Return Clist
|
||||
End Function
|
||||
|
||||
Public Function STB(ByVal src As String) As Byte()
|
||||
Return System.Text.Encoding.Default.GetBytes(src)
|
||||
End Function
|
||||
Public Function STB(ByVal src As Byte()) As String
|
||||
Return System.Text.Encoding.Default.GetString(src)
|
||||
End Function
|
||||
|
||||
'''공용코드의코드반환
|
||||
Public Function Get_CCode(ByVal gubun As String, ByVal name As String) As String
|
||||
Dim DR() As DS.tbl_commonRow = CType(DSET1.tbl_common.Select("gubun='" & gubun & "' and name='" & name & "'"), DS.tbl_commonRow())
|
||||
If DR.GetUpperBound(0) = -1 Then Return ""
|
||||
Return DR(0).code
|
||||
End Function
|
||||
|
||||
'''공용코드의이름반환
|
||||
Public Function Get_CName(ByVal gubun As String, ByVal code As String) As String
|
||||
Dim DR() As DS.tbl_commonRow = CType(DSET1.tbl_common.Select("gubun='" & gubun & "' and code='" & code & "'"), DS.tbl_commonRow())
|
||||
If DR.GetUpperBound(0) = -1 Then Return ""
|
||||
Return DR(0).name
|
||||
End Function
|
||||
|
||||
Public Function NVL(ByVal src As Object, Optional ByVal DefVal As Object = "") As Object
|
||||
Try
|
||||
If src.ToString = "" Or src Is DBNull.Value Then
|
||||
Return DefVal
|
||||
Else
|
||||
Return src
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Return DefVal
|
||||
End Try
|
||||
End Function
|
||||
|
||||
'''평가결과등급을 반환 (1~10등급까지 있으며 1등급은 +++ ,2등급은 ++ 3등급은 + 4등급부터 1로 시작함)
|
||||
Public Function 평가결과등급(주거용 As Integer, 일차에너지소요량합계 As Decimal) As Integer
|
||||
|
||||
If 주거용 <= 10 Then
|
||||
Select Case 일차에너지소요량합계
|
||||
Case Is < 60
|
||||
Return 1
|
||||
Case Is < 90
|
||||
Return 2
|
||||
Case Is < 120
|
||||
Return 3
|
||||
Case Is < 150
|
||||
Return 4
|
||||
Case Is < 190
|
||||
Return 5
|
||||
Case Is < 230
|
||||
Return 6
|
||||
Case Is < 270
|
||||
Return 7
|
||||
Case Is < 320
|
||||
Return 8
|
||||
Case Is < 370
|
||||
Return 9
|
||||
Case Else
|
||||
Return 10
|
||||
End Select
|
||||
Else
|
||||
Select Case 일차에너지소요량합계
|
||||
Case Is < 80
|
||||
Return 1
|
||||
Case Is < 140
|
||||
Return 2
|
||||
Case Is < 200
|
||||
Return 3
|
||||
Case Is < 260
|
||||
Return 4
|
||||
Case Is < 320
|
||||
Return 5
|
||||
Case Is < 380
|
||||
Return 6
|
||||
Case Is < 450
|
||||
Return 7
|
||||
Case Is < 520
|
||||
Return 8
|
||||
Case Is < 610
|
||||
Return 9
|
||||
Case Else
|
||||
Return 10
|
||||
End Select
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Public Sub Read_CommonCode(Optional ByVal Version As String = "")
|
||||
Work_msg("공용코드 확인중")
|
||||
If Version = "" Then
|
||||
Dim L As New ArinLogin.ArinLOgin
|
||||
Dim VersionInfo As ArinLogin.ArinLOgin.sVersionInfo = Nothing
|
||||
VersionInfo = L.Get_LastVersion("C2") '//버젼을 가져오는데 eco 버젼만 가져오게 바꺼야겟죵 ^^ 구분자를 넣도록 합시닷!
|
||||
Version = VersionInfo.Ver
|
||||
End If
|
||||
Try
|
||||
Dim TaC As New DSTableAdapters.tbl_commonTableAdapter
|
||||
TaC.Fill(DSET1.tbl_common)
|
||||
DSET1.tbl_Desc.Rows(0)("versionc") = Version
|
||||
DSET1.AcceptChanges()
|
||||
|
||||
TaC.Fill(DSET2.tbl_common)
|
||||
'DSET2.tbl_Desc.Rows(0)("versionc") = Version
|
||||
DSET2.AcceptChanges()
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("공용코드 업데이트실패" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "확인")
|
||||
End Try
|
||||
|
||||
Work_msg("")
|
||||
End Sub
|
||||
|
||||
Public Sub Read_ProfileData(Optional ByVal Version As String = "") '//2010.12.06 추가
|
||||
Work_msg("표준프로파일 확인중")
|
||||
If Version = "" Then
|
||||
Dim L As New ArinLogin.ArinLOgin
|
||||
Dim VersionInfo As ArinLogin.ArinLOgin.sVersionInfo = Nothing
|
||||
VersionInfo = L.Get_LastVersion("P2016") '//버젼을 가져오는데 eco 버젼만 가져오게 바꺼야겟죵 ^^ 구분자를 넣도록 합시닷! 160327 p2 -> P2016
|
||||
Version = VersionInfo.Ver
|
||||
End If
|
||||
Try
|
||||
Dim TaC As New DSTableAdapters.tbl_profileTableAdapter
|
||||
TaC.Fill(DSET1.tbl_profile)
|
||||
DSET1.tbl_Desc.Rows(0)("versionp") = Version
|
||||
DSET1.AcceptChanges()
|
||||
|
||||
TaC.Fill(DSET2.tbl_profile) '//160327 table PROFILE2 -> PROFILE_2016
|
||||
'DSET2.tbl_Desc.Rows(0)("versionp") = Version
|
||||
DSET2.AcceptChanges()
|
||||
Catch ex As Exception
|
||||
MsgBox("표준프로파일 업데이트실패" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "확인")
|
||||
End Try
|
||||
|
||||
'MsgBox(Version)
|
||||
|
||||
|
||||
Work_msg("")
|
||||
End Sub
|
||||
|
||||
Public Sub Read_WeatherData(Optional ByVal Version As String = "")
|
||||
Work_msg("기상데이터 확인중")
|
||||
Dim Iserror As Boolean = False
|
||||
If Version = "" Then
|
||||
Dim L As New ArinLogin.ArinLOgin
|
||||
Dim VersionInfo As ArinLogin.ArinLOgin.sVersionInfo = Nothing
|
||||
VersionInfo = L.Get_LastVersion("W2") '//버젼을 가져오는데 eco 버젼만 가져오게 바꺼야겟죵 ^^ 구분자를 넣도록 합시닷!
|
||||
Version = VersionInfo.Ver
|
||||
End If
|
||||
|
||||
DSET1.tbl_weather.Clear()
|
||||
DSET1.weather_cha.Clear()
|
||||
DSET1.weather_ilsa.Clear()
|
||||
DSET1.weather_temp.Clear()
|
||||
DSET1.weather_supdo.Clear()
|
||||
DSET1.AcceptChanges()
|
||||
|
||||
DSET2.tbl_weather.Clear()
|
||||
DSET2.weather_cha.Clear()
|
||||
DSET2.weather_ilsa.Clear()
|
||||
DSET2.weather_temp.Clear()
|
||||
DSET2.weather_supdo.Clear()
|
||||
DSET2.AcceptChanges()
|
||||
|
||||
Try
|
||||
Dim TaC As New DSTableAdapters.tbl_weatherTableAdapter
|
||||
TaC.Fill(DSET1.tbl_weather)
|
||||
TaC.Fill(DSET2.tbl_weather)
|
||||
Catch ex As Exception
|
||||
MsgBox("기상데이터0 업데이트실패" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "확인")
|
||||
Iserror = True
|
||||
End Try
|
||||
Try
|
||||
Dim TaC As New DSTableAdapters.weather_chaTableAdapter
|
||||
TaC.Fill(DSET1.weather_cha)
|
||||
TaC.Fill(DSET2.weather_cha)
|
||||
Catch ex As Exception
|
||||
MsgBox("기상데이터1 업데이트실패" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "확인")
|
||||
Iserror = True
|
||||
End Try
|
||||
Try
|
||||
Dim TaC As New DSTableAdapters.weather_ilsaTableAdapter
|
||||
TaC.Fill(DSET1.weather_ilsa)
|
||||
TaC.Fill(DSET2.weather_ilsa)
|
||||
Catch ex As Exception
|
||||
MsgBox("기상데이터2 업데이트실패" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "확인")
|
||||
Iserror = True
|
||||
End Try
|
||||
Try
|
||||
Dim TaC As New DSTableAdapters.weather_supdoTableAdapter
|
||||
TaC.Fill(DSET1.weather_supdo)
|
||||
TaC.Fill(DSET2.weather_supdo)
|
||||
Catch ex As Exception
|
||||
MsgBox("기상데이터3 업데이트실패" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "확인")
|
||||
Iserror = True
|
||||
End Try
|
||||
Try
|
||||
Dim TaC As New DSTableAdapters.weather_tempTableAdapter
|
||||
TaC.Fill(DSET1.weather_temp)
|
||||
TaC.Fill(DSET2.weather_temp)
|
||||
Catch ex As Exception
|
||||
MsgBox("기상데이터4 업데이트실패" & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical, "확인")
|
||||
Iserror = True
|
||||
End Try
|
||||
|
||||
If Iserror = False Then
|
||||
DSET1.tbl_Desc.Rows(0)("versionw") = Version
|
||||
'DSET2.tbl_Desc.Rows(0)("versionw") = Version
|
||||
'MsgBox(Version)
|
||||
DSET1.AcceptChanges()
|
||||
DSET2.AcceptChanges()
|
||||
End If
|
||||
|
||||
Work_msg("")
|
||||
End Sub
|
||||
|
||||
Public Function TOIT(ByVal obj As Object) As Integer
|
||||
If obj Is DBNull.Value Then
|
||||
Return 0
|
||||
ElseIf obj.ToString = "" Then
|
||||
Return 0
|
||||
Else
|
||||
If IsNumeric(obj) Then
|
||||
Return CInt(obj)
|
||||
Else
|
||||
MsgBox("[TOIT]숫자형식이 요구되지만 문자가 들어있습니다" & vbCrLf & obj.ToString, MsgBoxStyle.Critical, "확인")
|
||||
Return 0
|
||||
End If
|
||||
|
||||
End If
|
||||
End Function
|
||||
Public Function TOSG(ByVal obj As Object) As Decimal
|
||||
If obj Is DBNull.Value Then
|
||||
Return 0
|
||||
ElseIf obj.ToString = "" Then
|
||||
Return 0
|
||||
Else
|
||||
If IsNumeric(obj) Then
|
||||
Try
|
||||
Return CDec(obj)
|
||||
Catch ex As Exception
|
||||
MsgBox("[TOSG]에서 '" & obj & "'")
|
||||
Return 0
|
||||
End Try
|
||||
|
||||
Else
|
||||
MsgBox("[TOSG]숫자형식이 요구되지만 문자가 들어있습니다" & vbCrLf & obj.ToString, MsgBoxStyle.Critical, "확인")
|
||||
Return 0
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
Public Function TOST(ByVal obj As Object) As String
|
||||
If obj Is DBNull.Value Then
|
||||
Return ""
|
||||
Else
|
||||
Return CStr(obj)
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 데이터를 모두 되돌립니다.
|
||||
''' </summary>
|
||||
''' <param name="SrcDs"></param>
|
||||
''' <param name="DisplayLabel"></param>
|
||||
''' <remarks></remarks>
|
||||
Public Sub Data_Cancel(ByRef SrcDs As DataTable, Optional ByVal DisplayLabel As ToolStripStatusLabel = Nothing)
|
||||
Dim Change As Integer
|
||||
Try
|
||||
Change = SrcDs.GetChanges.Rows.Count
|
||||
Catch ex As Exception
|
||||
Change = 0
|
||||
End Try
|
||||
|
||||
If Change > 0 Then
|
||||
If MsgBox("변경된 내용을 취소하시겠습니까?", CType(MsgBoxStyle.Critical + MsgBoxStyle.OkCancel, MsgBoxStyle), "확인") = MsgBoxResult.Ok Then
|
||||
SrcDs.RejectChanges()
|
||||
If Not DisplayLabel Is Nothing Then
|
||||
NOTICE("변경된 내용이 취소되었습니다", DisplayLabel, Color.Red)
|
||||
Else
|
||||
MsgBox("변경된 내용이 취소되었습니다", MsgBoxStyle.Information, "확인")
|
||||
End If
|
||||
Else
|
||||
If Not DisplayLabel Is Nothing Then NOTICE("취소되었습니다", DisplayLabel, Color.Blue)
|
||||
End If
|
||||
End If
|
||||
If Not DisplayLabel Is Nothing Then
|
||||
NOTICE("변경된 내용이 없습니다.", DisplayLabel, Color.Red)
|
||||
Else
|
||||
MsgBox("변경된 내용이 없습니다", MsgBoxStyle.Information, "확인")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function EndEdit(ByRef bs As BindingSource) As Boolean
|
||||
Try
|
||||
bs.EndEdit()
|
||||
Catch ex As System.Data.NoNullAllowedException
|
||||
MsgBox("반드시입력해야할 데이터가 없습니다" & vbCrLf & ex.Message, MsgBoxStyle.Critical, "입력오류")
|
||||
Return False
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message.ToString, MsgBoxStyle.Critical, "처리되지않은 오류발생")
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Sub Check_Modify(ByRef DT As DataTable, Optional ByVal prompt As Boolean = True)
|
||||
Dim Cnt As Integer
|
||||
Try
|
||||
Cnt = DT.GetChanges.Rows.Count
|
||||
Catch ex As Exception
|
||||
Cnt = 0
|
||||
End Try
|
||||
|
||||
If Cnt < 1 Then
|
||||
NOTICE("변경된 내용이 없습니다", Nothing, Color.Red)
|
||||
Return
|
||||
End If
|
||||
If prompt Then
|
||||
If MsgBox("변경된 데이터를 저장하시겠습니까?", CType(MsgBoxStyle.Information + MsgBoxStyle.OkCancel, MsgBoxStyle), "저장확인") <> MsgBoxResult.Ok Then Return
|
||||
End If
|
||||
Try
|
||||
DT.AcceptChanges() '//Set All Green
|
||||
NOTICE("저장완료", Nothing, Color.Blue)
|
||||
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Exclamation)
|
||||
Catch ex As Exception
|
||||
MsgBox("데이터베이스 업데이트중 오류가 발생했습니다" & vbCrLf & vbCrLf & ex.ToString, MsgBoxStyle.Critical, "ERROR-")
|
||||
NOTICE("저장 실패!", Nothing, Color.Red)
|
||||
Finally
|
||||
'view1.ActiveSheet.GetDataView(True) '//화면을 갱신한다.
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
'//지정된개체내의 컨트롤의 값을 초기화한다.
|
||||
Public Sub Clear_Control(ByVal Ctl As Control)
|
||||
Ctl.Focus()
|
||||
For Each C As Control In Ctl.Controls
|
||||
MsgBox(C.GetType.ToString)
|
||||
If C.Controls.Count > 1 Then
|
||||
Clear_Control(C)
|
||||
Else
|
||||
If C.GetType.ToString.ToUpper.IndexOf("TEXTBOX") <> -1 OrElse _
|
||||
C.GetType.ToString.ToUpper.IndexOf("MYTB") <> -1 OrElse _
|
||||
C.GetType.ToString.ToUpper.IndexOf("NTB") <> -1 Then
|
||||
If CType(C, TextBox).ReadOnly = False Then CType(C, TextBox).Text = ""
|
||||
ElseIf C.GetType.ToString.ToUpper.IndexOf("COMBOBOX") <> -1 OrElse _
|
||||
C.GetType.ToString.ToUpper.IndexOf("MYCMB") <> -1 Then
|
||||
'MsgBox("cb")
|
||||
CType(C, ComboBox).SelectedIndex = -1
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub Work_msg(Optional ByVal P_m As String = "잠시만 기다려주세요", Optional ByVal pbar As Boolean = False)
|
||||
If P_m = "" Then
|
||||
Frm_Work.Dispose()
|
||||
Else
|
||||
If Frm_Work.Visible = False Then Frm_Work.Visible = True
|
||||
If Frm_Work.ProgressBar1.Visible <> pbar Then Frm_Work.ProgressBar1.Visible = pbar
|
||||
Frm_Work.Label1.Text = P_m
|
||||
My.Application.DoEvents()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
'''화면에메세지를 표시할때사용한다.
|
||||
Public Sub Work_msg_timer(Optional ByVal P_m As String = "잠시만 기다려주세요", Optional ByVal time As Short = 5)
|
||||
Frm_Warning.Left = CInt(MdiMain.Left + ((MdiMain.Width - Frm_Warning.Width) / 2))
|
||||
Frm_Warning.Top = CInt(MdiMain.Top + ((MdiMain.Height - Frm_Warning.Height) / 2))
|
||||
Frm_Warning.Term = time
|
||||
Frm_Warning.Second = time
|
||||
Frm_Warning.Label1.Text = P_m
|
||||
Frm_Warning.Timer1.Enabled = True
|
||||
Frm_Warning.Show()
|
||||
My.Application.DoEvents()
|
||||
End Sub
|
||||
|
||||
Public Sub Work_plus()
|
||||
If Frm_Work.ProgressBar1.Visible = False Then Frm_Work.ProgressBar1.Visible = True
|
||||
Frm_Work.ProgressBar1.Value += 1
|
||||
My.Application.DoEvents()
|
||||
End Sub
|
||||
|
||||
Public Sub INitRow(ByVal Ctl As Control.ControlCollection)
|
||||
For Each C As Control In Ctl
|
||||
If C.Controls.Count > 1 Then
|
||||
INitRow(C.Controls)
|
||||
Else
|
||||
If C.GetType.ToString.ToUpper.IndexOf("MYTB") <> -1 Then
|
||||
If CType(C, MyTb).Text = "" Then CType(C, MyTb).Text = "0"
|
||||
ElseIf C.GetType.ToString.ToUpper.IndexOf("MYCMB") <> -1 Then
|
||||
If CType(C, MyCmb).Text = "" AndAlso CType(C, MyCmb).Items.Count > 0 Then CType(C, MyCmb).SelectedIndex = 0
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Function DeCryptArea(ByRef data As Byte(), Optional ByVal pxorkey() As Byte = Nothing) As Byte()
|
||||
Dim out(data.Length - 1) As Byte
|
||||
Dim pos As Integer = 0
|
||||
Dim i As Long = 0
|
||||
|
||||
'//처음4바이트확인해서 보낸다.
|
||||
Dim XorKey() As Byte
|
||||
If pxorkey Is Nothing Then '//없으면 자동검출
|
||||
XorKey = New Byte() {data(0), data(1), data(2), data(3)}
|
||||
Else '//있으면 그걸 사용한다.
|
||||
XorKey = New Byte() {pxorkey(0), pxorkey(1), pxorkey(2), pxorkey(3)}
|
||||
End If
|
||||
|
||||
For Each b As Byte In data
|
||||
out(i) = DeCryptByte(b, pos, XorKey)
|
||||
pos += 1
|
||||
i += 1
|
||||
If pos > 3 Then pos = 0
|
||||
Next
|
||||
Return out
|
||||
End Function
|
||||
Public Function DeCryptByte(ByVal num As Byte, ByVal column As Integer, Optional ByVal a() As Byte = Nothing) As Byte
|
||||
If a Is Nothing Then a = New Byte() {&HAC, &H29, &H55, &H42}
|
||||
Return (num Xor a(column))
|
||||
End Function
|
||||
|
||||
Public Function EnCryptByte(ByVal num As Byte, ByVal column As Integer, Optional ByVal a() As Byte = Nothing) As Byte
|
||||
If a Is Nothing Then a = New Byte() {&HAC, &H29, &H55, &H42}
|
||||
Return (num Xor a(column))
|
||||
End Function
|
||||
End Module
|
||||
Reference in New Issue
Block a user