initial commit
This commit is contained in:
57
GetReport/GetReport.csproj
Normal file
57
GetReport/GetReport.csproj
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F7A56F1E-F108-4C83-8619-8B29B2CF2E6E}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>GetReport</RootNamespace>
|
||||
<AssemblyName>GetReport</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Runtime\OD\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Runtime\OD\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>
|
||||
9
GetReport/GetReport.csproj.user
Normal file
9
GetReport/GetReport.csproj.user
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<StartArguments>"c:\temp\test.ecl2"</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<StartArguments>"D:\Tinsky\Visual Basic For ENERGY\Runtime\OD\New.ecl2"</StartArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
126
GetReport/Program.cs
Normal file
126
GetReport/Program.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GetReport
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Ecl2파일에서 최종보고서를 불러옵니다.
|
||||
/// </summary>
|
||||
class Program
|
||||
{
|
||||
struct s_Porject
|
||||
{
|
||||
public string Filename;
|
||||
public string Maketime;
|
||||
public string Desc;
|
||||
public string UIVersion;
|
||||
public string LGVersion;
|
||||
public string Name;
|
||||
public string SFType;
|
||||
public string MakeTime;
|
||||
public string EditTime;
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//#if(DEBUG)
|
||||
// Console.WriteLine("Debug Mode");
|
||||
// Console.WriteLine(string.Format("Param len={0}", args.Length));
|
||||
//#endif
|
||||
string msgtitle =
|
||||
"이 프로그램은 ECO2-OD의 저장파일(*.ecl2)에서 최종결과 보고서를 추출하는 프로그램입니다.\r\n" +
|
||||
"프로그램 실행시 파라미터로 추출하고자하는 파일명을 입력하세요\r\n\r\n" +
|
||||
"경로 및 파일명에 공백이 있는 경우에는 큰따옴표로 묶어서 입력하시기 바랍니다.\r\n\r\n" +
|
||||
"예) GetReport.exe " + (char)(0x22) + "c:\\Sample File\\test.ecl2" + (char)(0x22) +
|
||||
"\r\n예) GetReport.exe new.ecl2";
|
||||
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
//display Usage
|
||||
System.Text.StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(msgtitle);
|
||||
sb.AppendLine();
|
||||
//sb.AppendLine("아무키나 누르면 종료합니다");
|
||||
Console.WriteLine(sb.ToString());
|
||||
//Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo(args[0]);
|
||||
if (!fi.Exists)
|
||||
{
|
||||
System.Text.StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(msgtitle);
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("존재하지 않는 파일명을 입력했습니다");
|
||||
sb.AppendLine("파일명 : " + fi.FullName);
|
||||
Console.WriteLine(sb.ToString());
|
||||
//Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
|
||||
//자료를 읽어서 테이블을 추출한 후 그 정보를 역 출력한다
|
||||
byte[] source = System.IO.File.ReadAllBytes(fi.FullName);
|
||||
if (source.Length < 4)
|
||||
{
|
||||
System.Text.StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(msgtitle);
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("데이터가 올바르지 않습니다.");
|
||||
sb.AppendLine("데이터길이 : " + source.Length.ToString());
|
||||
Console.WriteLine(sb.ToString());
|
||||
//Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
|
||||
System.IO.MemoryStream fs = new System.IO.MemoryStream(source);
|
||||
System.IO.BinaryReader Br = new System.IO.BinaryReader(fs, System.Text.Encoding.Default);
|
||||
s_Porject prj = new s_Porject();
|
||||
|
||||
//read data
|
||||
prj.Filename = fi.FullName;
|
||||
prj.SFType = System.Text.Encoding.Default.GetString(Br.ReadBytes(2));
|
||||
prj.UIVersion = System.Text.Encoding.Default.GetString(Br.ReadBytes(10));
|
||||
prj.LGVersion = System.Text.Encoding.Default.GetString(Br.ReadBytes(10));
|
||||
|
||||
prj.Name = System.Text.Encoding.Default.GetString(Br.ReadBytes(100));
|
||||
prj.Desc = System.Text.Encoding.Default.GetString(Br.ReadBytes(256));
|
||||
prj.MakeTime = System.Text.Encoding.Default.GetString(Br.ReadBytes(19));
|
||||
prj.EditTime = System.Text.Encoding.Default.GetString(Br.ReadBytes(19));
|
||||
|
||||
//setting data read
|
||||
System.Data.DataSet DSET1 = new System.Data.DataSet();
|
||||
Int64 DS1Len = Br.ReadInt64();
|
||||
byte[] DS1 = Br.ReadBytes((int)DS1Len);
|
||||
System.IO.MemoryStream Ms = new System.IO.MemoryStream(DS1);
|
||||
DSET1.ReadXml(Ms);
|
||||
DSET1.AcceptChanges();
|
||||
Ms.Close();
|
||||
|
||||
//readreport
|
||||
System.Data.DataSet DSETR1 = new System.Data.DataSet();
|
||||
DS1Len = Br.ReadInt64();
|
||||
DS1 = Br.ReadBytes((int)DS1Len);
|
||||
Ms = new System.IO.MemoryStream(DS1);
|
||||
DSETR1.ReadXml(Ms);
|
||||
DSETR1.AcceptChanges();
|
||||
Ms.Close();
|
||||
|
||||
//System.Text.StringBuilder sb2 = new StringBuilder();
|
||||
//sb2.AppendLine("Table Count = " + DSETR1.Tables.Count.ToString());
|
||||
//sb2.AppendLine("Table 1 = " + DSETR1.Tables[0].ToString());
|
||||
|
||||
//보고서테이블의 내용을 화면에 출력한다.
|
||||
System.IO.StringWriter sw = new System.IO.StringWriter();
|
||||
DSETR1.Tables[0].WriteXml(sw, false);
|
||||
Console.WriteLine(sw.ToString());
|
||||
//sb2.AppendLine(sw.ToString());
|
||||
sw.Dispose();
|
||||
//Console.ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
GetReport/Properties/AssemblyInfo.cs
Normal file
36
GetReport/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
|
||||
// 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이 특성 값을 변경하십시오.
|
||||
[assembly: AssemblyTitle("GetReport")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("GetReport")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("9b52112f-6de3-4b4d-b1a3-685a15ebdc76")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
|
||||
// 지정되도록 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Reference in New Issue
Block a user