Skip to content

Commit e26d6ef

Browse files
preisspreiss
authored andcommitted
Projektdateien hinzufügen.
1 parent 7440794 commit e26d6ef

File tree

6 files changed

+432
-0
lines changed

6 files changed

+432
-0
lines changed

CSharpFinder.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33424.131
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpFinder", "CSharpFinder\CSharpFinder.csproj", "{3EF5C29E-F522-4AC1-B64B-65F95CDAB068}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{3EF5C29E-F522-4AC1-B64B-65F95CDAB068}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{3EF5C29E-F522-4AC1-B64B-65F95CDAB068}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{3EF5C29E-F522-4AC1-B64B-65F95CDAB068}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{3EF5C29E-F522-4AC1-B64B-65F95CDAB068}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {0C71F8CC-06C3-461A-8DD1-797950BE4B99}
24+
EndGlobalSection
25+
EndGlobal

CSharpFinder/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
</configuration>

CSharpFinder/CSharpFinder.csproj

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{3EF5C29E-F522-4AC1-B64B-65F95CDAB068}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>CSharpFinder</RootNamespace>
10+
<AssemblyName>CSharpFinder</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>x64</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Logger.cs" />
47+
<Compile Include="Program.cs" />
48+
<Compile Include="Properties\AssemblyInfo.cs" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<None Include="App.config" />
52+
</ItemGroup>
53+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
54+
</Project>

CSharpFinder/Logger.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using System;
2+
using System.IO;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Globalization;
8+
9+
namespace CSharpFinder
10+
{
11+
public class Logger
12+
{
13+
private readonly string logFilePath;
14+
15+
public Logger(string filePath)
16+
{
17+
logFilePath = filePath;
18+
string directory = new FileInfo(logFilePath).Directory.FullName;
19+
20+
// Prüfen ob Verzeichnis existiert
21+
if (!Directory.Exists(directory))
22+
{
23+
Directory.CreateDirectory(directory);
24+
}
25+
26+
// Prüfen ob Datei existiert
27+
if (!File.Exists(logFilePath))
28+
{
29+
File.Create(logFilePath).Close();
30+
}
31+
}
32+
33+
public void Info(string message)
34+
{
35+
using (StreamWriter sw = File.AppendText(logFilePath))
36+
{
37+
sw.WriteLine($"INFO | {DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss")} | {message}");
38+
}
39+
}
40+
41+
public void Error(string message)
42+
{
43+
using (StreamWriter sw = File.AppendText(logFilePath))
44+
{
45+
sw.WriteLine($"ERROR | {DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss")} | {message}");
46+
}
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)