Есть два *.cs файла. Один из них Program.cs, другой filereader.cs Как отобразить требуемое, будучи это строка или перменная?
Program.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ConsoleApp2
{
public class Program
{
static void Main(string[] args)
{
string[] file1 = File.ReadAllLines(@"C:\Users\Admin\Desktop\test2.txt");
foreach(var line1 in file1)
{
}
string string1 = "123abc";
Console.ReadKey();
}
}
}
filereader.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
public class filreader
{
public static void main()
{
Console.WriteLine(тут отобразить line1);
Console.WriteLine(тут отобразить string1);
}
}
}
P.S. Еще одну вещь хотел узнать..как использовать в filereader.cs line1, которая в foreach находиться ?