Bläddra i källkod

Добавьте файлы проекта.

Настя Быкова 2 år sedan
förälder
incheckning
c6ef1aae21

+ 22 - 0
TestP1/TestP1.csproj

@@ -0,0 +1,22 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+
+    <IsPackable>false</IsPackable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
+    <PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
+    <PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
+    <PackageReference Include="coverlet.collector" Version="3.1.2" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\ex_Bykova31p\ex_Bykova31p.csproj" />
+  </ItemGroup>
+
+</Project>

+ 12 - 0
TestP1/UnitTest1.cs

@@ -0,0 +1,12 @@
+using exem_var3;
+namespace TestP1
+{
+    [TestClass]
+    public class UnitTest1
+    {
+        [TestMethod]
+        public void TestMethod1()
+        {
+        }
+    }
+}

+ 1 - 0
TestP1/Usings.cs

@@ -0,0 +1 @@
+global using Microsoft.VisualStudio.TestTools.UnitTesting;

+ 31 - 0
ex_Bykova31p.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.2.32526.322
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_Bykova31p", "\main\RDP\31П\БыковаАА\Desktop\ex_Bykova31p\ex_Bykova31p\ex_Bykova31p\ex_Bykova31p.csproj", "{D8157BB4-398C-4DC5-A38C-A3770E54E4E2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestP1", "\main\RDP\31П\БыковаАА\Desktop\ex_Bykova31p\ex_Bykova31p\TestP1\TestP1.csproj", "{E646D819-83A9-4683-A25E-804FE143D377}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{D8157BB4-398C-4DC5-A38C-A3770E54E4E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D8157BB4-398C-4DC5-A38C-A3770E54E4E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D8157BB4-398C-4DC5-A38C-A3770E54E4E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D8157BB4-398C-4DC5-A38C-A3770E54E4E2}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E646D819-83A9-4683-A25E-804FE143D377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E646D819-83A9-4683-A25E-804FE143D377}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E646D819-83A9-4683-A25E-804FE143D377}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E646D819-83A9-4683-A25E-804FE143D377}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {791D6EA8-4621-4F4F-96A2-A03EFD3C40F2}
+	EndGlobalSection
+EndGlobal

+ 26 - 0
ex_Bykova31p/Deb.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Diagnostics;
+using System.IO;
+
+namespace exem_var3
+{
+    public class Deb
+    {
+        /// <summary>
+        /// Строка записи в файл diagW.txt
+        /// </summary>
+        /// <param name="str">Строка записи в файл</param>
+        public static void diagW(string str)
+        {
+            TextWriterTraceListener x = new TextWriterTraceListener(File.AppendText("diagW.txt"));
+            Trace.Listeners.Add(x);
+            Debug.WriteLine(str);
+            Debug.Flush();
+            x.Close();
+        }
+    }
+}

+ 31 - 0
ex_Bykova31p/Mod1.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Diagnostics;
+using System.IO;
+
+namespace exem_var3
+{
+    public class Mod1
+    {
+        public string read()//метод считывания данных из файла
+        {
+            string data = "data.txt";
+            string[] da = new string[400];
+            da = File.ReadAllLines(data);
+            string[] text = new string[400];
+            int k = 0;
+            for (int i = 0; i < da.Length; i++)
+            {
+                Console.WriteLine(da[i]);
+                text[i] = Convert.ToString(da[i].Split(';'));
+                k++;
+            }
+            Deb.diagW("Данные считанны");
+            return text[k];
+
+        }
+    }
+}

+ 14 - 0
ex_Bykova31p/Mod2.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Diagnostics;
+using System.IO;
+
+namespace ex_Bykova31p
+{
+    internal class Mod2
+    {
+    }
+}

+ 17 - 0
ex_Bykova31p/Program.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Diagnostics;
+using System.IO;
+
+namespace exem_var3
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+            Mod1 m1 = new Mod1();
+            m1.read();
+
+            Deb.diagW("Программа запущена");
+        }
+    }
+}

+ 10 - 0
ex_Bykova31p/ex_Bykova31p.csproj

@@ -0,0 +1,10 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+</Project>