本文整理汇总了C#中FileReader类的典型用法代码示例。如果您正苦于以下问题:C# FileReader类的具体用法?C# FileReader怎么用?C# FileReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileReader类属于命名空间,在下文中一共展示了FileReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
//Initialize browser
PropertiesCollection.driver = new FirefoxDriver();
Console.WriteLine("Opened Browser");
//Read File
FileReader file = new FileReader();
file.ReadFile("e:/Documents/Programs/C#/LoanPaymentAutomationTests/info.txt");
//Navigate to Loan Site
PropertiesCollection.driver.Navigate().GoToUrl(file.info(11));
//Login through 2 pages
LoginPage page1 = new LoginPage("user-id");
SecureLoginPage page2 = page1.Login(file);
//Make payments and submit
AccountSummaryPage page3 = page2.Submit(file);
MakeAPaymentPage page4 = page3.MakeAPayment();
SpecialPaymentPage page5 = page4.SubmitPayment(file);
PaymentPreviewPage page6 = page5.Next();
page6.btnSubmit.Click();
//Close browser
PropertiesCollection.driver.Close();
Console.WriteLine("Close the browser");
Log();
}
示例2: Read
internal static Account Read(System.IO.FileInfo file)
{
MoneyParser = new SimpleMoneyParser();
FileReader reader = new FileReader(file.FullName);
var lines = reader.ReadAllLines();
string name = ParseFileName(file.Name);
Console.Out.WriteLine("\n\n{0}", name);
var utSaldo = ParseSaldoLine(lines[0]);
lines.RemoveAt(0);
lines.RemoveAt(0); //Headings
var innSaldo = ParseSaldoLine(lines[lines.Count - 1]);
lines.RemoveAt(lines.Count -1);
Account result = new Account(file.Name, name, innSaldo, utSaldo);
foreach (var line in lines)
{
AccountLine aLine = ParseLine(line, name);
result.AddLine(aLine);
}
return result;
}
示例3: AlgoMetaData
public AlgoMetaData(string name, IAutoGenerator autoGenerator = null, FileReader fileReader = null, ManualInput manualInput = null)
{
Name = name;
AutoGenerator = autoGenerator;
FileReader = fileReader;
InputFunction = manualInput;
}
示例4: TestStreamIsNoCompressionForRandomFileExtension
public void TestStreamIsNoCompressionForRandomFileExtension(string fileExt)
{
var stream = new FileStreamMock("C:\\PAth\\pakjdkjd\\test." + fileExt);
var test = new FileReader(stream);
test.Compression.ShouldBeEquivalentTo(CompressionScheme.None);
}
示例5: RecordsFromMultipleInputFilesWrittenToCorrespondingOutputFiles
public void RecordsFromMultipleInputFilesWrittenToCorrespondingOutputFiles()
{
// Arrange
File.WriteAllLines(this.workingDirectory + "FileA.txt", new String[] { "a", "b", "c", "d", "e", "f" });
File.WriteAllLines(this.workingDirectory + "FileB.txt", new String[] { "g", "h", "i", "j", "k", "l" });
var mockStatisticsCollector = Substitute.For<IStatisticsCollector>();
var writer = new InputFileRecordWriter(mockStatisticsCollector, true, true);
using (FileReader inputFileA = new FileReader(this.workingDirectory + "FileA.txt"))
{
using (FileReader inputFileB = new FileReader(this.workingDirectory + "FileB.txt"))
{
// Act
writer.WriteMatchedRecord(inputFileA, new Record { Start = 0, End = 8 });
writer.WriteMatchedRecord(inputFileB, new Record { Start = 0, End = 8 });
writer.WriteUnmatchedRecord(inputFileA, new Record { Start = 9, End = 18 });
writer.WriteUnmatchedRecord(inputFileB, new Record { Start = 9, End = 18 });
writer.Close();
}
}
// Assert
File.Exists(this.workingDirectory + "Matched_From_FileA.txt").ShouldBeTrue();
File.ReadAllLines(this.workingDirectory + "Matched_From_FileA.txt").ShouldBeEquivalentTo(new String[] { "a", "b", "c" });
File.Exists(this.workingDirectory + "Matched_From_FileB.txt").ShouldBeTrue();
File.ReadAllLines(this.workingDirectory + "Matched_From_FileB.txt").ShouldBeEquivalentTo(new String[] { "g", "h", "i" });
File.Exists(this.workingDirectory + "Unmatched_From_FileA.txt").ShouldBeTrue();
File.ReadAllLines(this.workingDirectory + "Unmatched_From_FileA.txt").ShouldBeEquivalentTo(new String[] { "d", "e", "f" });
File.Exists(this.workingDirectory + "Unmatched_From_FileB.txt").ShouldBeTrue();
File.ReadAllLines(this.workingDirectory + "Unmatched_From_FileB.txt").ShouldBeEquivalentTo(new String[] { "j", "k", "l" });
}
示例6: TestStreamIsGzipForKnownExt
public void TestStreamIsGzipForKnownExt()
{
var stream = new FileStreamMock("C:\\PAth\\pakjdkjd\\test.gz");
var test = new FileReader(stream);
test.Compression.ShouldBeEquivalentTo(CompressionScheme.GZip);
}
示例7: Bone
public Bone(FileReader Reader, int Index)
{
BoneIndex = Index;
Reader.ReadUInt32(); //Unknown
Name = Reader.ReadPascalString();
ParentName = Reader.ReadPascalString();
HasPropertyList = (Reader.ReadByte() != 0) ? true : false;
if(HasPropertyList)
{
uint PropertyCount = Reader.ReadUInt32();
for (int i = 0; i < PropertyCount; i++)
PropertyList.Add(new Property(Reader));
}
Translation = new Vector3(Reader.ReadFloat(), Reader.ReadFloat(), Reader.ReadFloat());
Rotation = new Quaternion(Reader.ReadFloat(), -Reader.ReadFloat(), -Reader.ReadFloat(), Reader.ReadFloat());
CanTranslate = (Reader.ReadUInt32() != 0) ? true : false;
CanRotate = (Reader.ReadUInt32() != 0) ? true : false;
CanBlend = (Reader.ReadUInt32() != 0) ? true : false;
//Don Hopkins says the Wiggle parameters are left over from an attempt to use Perlin noise
//introduce some randomness into the animations, so that an animation would look a little different
//each time it was run.
Reader.ReadFloat();
Reader.ReadFloat();
}
示例8: WikiGenerator
public WikiGenerator(Convertor sourceConvertor, string rootPath, IPageCache pageCache)
{
this.convertor = sourceConvertor;
this.rootWikiPath = rootPath;
this.pageCache = pageCache;
this.fileReader = new FileReader(FileReaderPolicy.LimitedBlock, 500);
}
示例9: TestDisposeOfStream
public void TestDisposeOfStream(IFileStreamWrap stream)
{
var test = new FileReader(stream);
test.Dispose();
test.Stream.ShouldBeEquivalentTo(null);
}
示例10: Property
/// <summary>
/// Constructs a new Property instance.
/// </summary>
/// <param name="Reader">A FileReader instance, used to read the Property.</param>
public Property(FileReader Reader)
{
uint PairCount = Reader.ReadUInt32();
for (int i = 0; i < PairCount; i++)
PropertyPairs.Add(Reader.ReadPascalString(), Reader.ReadPascalString());
}
示例11: IFFChunk
public IFFChunk(FileReader Reader, GraphicsDevice Device, Iff Parent)
{
m_Parent = Parent;
m_Device = Device;
ReadHeader(Reader);
}
示例12: HIM
public HIM(string file)
{
FileReader fr = new FileReader ( file );
Length = fr.Read<int> ();
Width = fr.Read<int> ();
GridCount = fr.Read<int> ();
GridSize = fr.Read<float> ();
//fr.BaseStream.Seek (8, System.IO.SeekOrigin.Current);
Heights = new float[Length, Width];
MinHeight = 10000000000000000000.0f;
MaxHeight = 10000.0f;
for (int y = 0; y < Length; ++y)
{
for (int x = 0; x < Width; ++x)
{
Heights [y, x] = fr.Read<float> ();
if (Heights [y, x] < MinHeight)
MinHeight = Heights [y, x];
if (Heights [y, x] > MaxHeight)
MaxHeight = Heights [y, x];
}
}
fr.Close ();
}
示例13: ItemReturn
public ItemReturn(Data data)
{
this.data = data;
resources = data.Resources;
reader = new FileReader(data);
writer = new FileWriter(data);
}
示例14: ReadFileObject
public void ReadFileObject(FileReader reader)
{
Name = reader.ReadString();
Offset = reader.ReadInt32();
Size = reader.ReadInt32();
//reader.BaseStream.Position = Offset;
//Bytes = reader.ReadByteArray(Size);
}
示例15: BoneBinding
public BoneBinding(FileReader Reader)
{
BoneIndex = Reader.ReadUInt32();
FirstRealVertexIndex = Reader.ReadUInt32();
RealVertexCount = Reader.ReadUInt32();
FirstBlendVertexIndex = Reader.ReadUInt32();
BlendVertexCount = Reader.ReadUInt32();
}