class Program
{
static void Main(string[] args)
{
StrokeScribeClass ss = new StrokeScribeClass();
ss.Alphabet = enumAlphabet.DATAMATRIX;
ss.DataMatrixMinSize = 16;
ss.ECI = 0;
ss.UTF8 = false;
Console.Write("Input : ");
string txt;
txt = Console.ReadLine();
ss.Text = txt;
int w = ss.BitmapW;
int h = ss.BitmapH;
ss.SavePicture(txt + ".bmp", enumFormats.BMP, w * 2, h * 2);
System.Console.Write(ss.ErrorDescription);
}
}
class WriteTextFile
{
static void Second()
{
Console.Write("Input : ");
string txt;
txt = Console.ReadLine();
System.IO.File.WriteAllText(@"C:\Users\Chad\Desktop\studio07\rinhoceros\20140428\WriteText.txt", txt);
}
}
第一类Program
是控制台创建数据矩阵的部分,其中输入的字词是控制台和第二类WriteTextFile
部分;我试图做的是从第一个代码(类程序)输入到控制台的文本中的txt文件
他们都分开工作。我认为上课可能是一个问题,静态空白可能是一个问题。请帮帮我
答案 0 :(得分:0)
将您希望存储的数据传递给第二课程文本文件:
class Program
{
static void Main(string[] args)
{
StrokeScribeClass ss = new StrokeScribeClass();
ss.Alphabet = enumAlphabet.DATAMATRIX;
ss.DataMatrixMinSize = 16;
ss.ECI = 0;
ss.UTF8 = false;
Console.Write("Input : ");
string txt;
txt = Console.ReadLine();
ss.Text = txt;
int w = ss.BitmapW;
int h = ss.BitmapH;
ss.SavePicture(txt + ".bmp", enumFormats.BMP, w * 2, h * 2);
System.Console.Write(ss.ErrorDescription);
WriteTextFile.Second(txt);
}
}
class WriteTextFile
{
static void Second(string fileText)
{
System.IO.File
.WriteAllText(@"C:\Users\Chad\Desktop\studio07\rinhoceros\20140428\WriteText.txt", fileText);
}
}