Advertisement
oshige_san

Untitled

May 19th, 2022
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.00 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace kurs_aisd1
  10. {
  11.     class Program
  12.     {
  13.         public const string CppFunctionDll = @"C:\Users\Анастасия\source\repos\Алгоритм_сортировки\Debug\Алгоритм_сортировки.dll";
  14.  
  15.         [DllImport(CppFunctionDll, CallingConvention = CallingConvention.Cdecl)]
  16.         public static extern void Sort(string[] Line, int n);
  17.  
  18.          [STAThread]
  19.  
  20.         static void Main(string[] args)
  21.         {
  22.             //string FN = null;
  23.             //System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
  24.             //if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  25.             //    FN = dlg.FileName;
  26.             //if (FN == null)
  27.             //    return;
  28.             //using (StreamReader streamReader = new StreamReader(FN))
  29.             //{
  30.             //    string tLine = null;
  31.             //    while ((tLine = streamReader.ReadLine()) != null)
  32.             //    {
  33.             //        //string[] Line = tLine.Split(';'); <----- здесь
  34.  
  35.             //    }
  36.             //}
  37.  
  38.             string[] Line = { //Надо массив загрузить из файла строка + сплит
  39.                 "ACD", "ABD", "Zdsad","BAF", "BAA", "FDG"
  40.             };
  41.             Console.WriteLine("До сортировки:");
  42.             //StreamWriter sw = new StreamWriter(path);
  43.             foreach (var item in Line)
  44.             {
  45.                 Console.WriteLine(item);
  46.             //    sw.Write(item + " ");
  47.             }
  48.            Sort(Line, Line.Length);
  49.             //foreach (var item in Line)
  50.             //{
  51.             //    Console.WriteLine(item);
  52.             //    //    sw.Write(item + " ");
  53.             //}
  54.             //Console.WriteLine($"{Sum(6,2)}");
  55.             //Console.ReadKey();
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement