• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FileReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FileReader的典型用法代码示例。如果您正苦于以下问题:C# FileReader类的具体用法?C# FileReader怎么用?C# FileReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FileReader类属于命名空间,在下文中一共展示了FileReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
        }
开发者ID:jacobshumate,项目名称:LoanPaymentAutomation,代码行数:30,代码来源:Program.cs


示例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;
        }
开发者ID:haugholt,项目名称:MoneyOverview,代码行数:27,代码来源:AccountReader.cs


示例3: AlgoMetaData

 public AlgoMetaData(string name, IAutoGenerator autoGenerator = null, FileReader fileReader = null, ManualInput manualInput = null)
 {
     Name = name;
     AutoGenerator = autoGenerator;
     FileReader = fileReader;
     InputFunction = manualInput;
 }
开发者ID:anhlehoang410,项目名称:Game-5,代码行数:7,代码来源:AlgoMetaData.cs


示例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);
        }
开发者ID:UCL-Genomics,项目名称:genomics-common,代码行数:7,代码来源:FileReaderTests.cs


示例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" });
        }
开发者ID:toyners,项目名称:Siftan,代码行数:34,代码来源:InputFileRecordWriter_IntegrationTests.cs


示例6: TestStreamIsGzipForKnownExt

        public void TestStreamIsGzipForKnownExt()
        {
            var stream = new FileStreamMock("C:\\PAth\\pakjdkjd\\test.gz");

            var test = new FileReader(stream);
            test.Compression.ShouldBeEquivalentTo(CompressionScheme.GZip);
        }
开发者ID:UCL-Genomics,项目名称:genomics-common,代码行数:7,代码来源:FileReaderTests.cs


示例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();
        }
开发者ID:Afr0Games,项目名称:Project-Dollhouse,代码行数:29,代码来源:Bone.cs


示例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);
 }
开发者ID:sbyse,项目名称:icklewik,代码行数:7,代码来源:WikiGenerator.cs


示例9: TestDisposeOfStream

        public void TestDisposeOfStream(IFileStreamWrap stream)
        {
            var test = new FileReader(stream);
            test.Dispose();

            test.Stream.ShouldBeEquivalentTo(null);
        }
开发者ID:UCL-Genomics,项目名称:genomics-common,代码行数:7,代码来源:FileReaderTests.cs


示例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());
        }
开发者ID:Afr0Games,项目名称:Project-Dollhouse,代码行数:11,代码来源:Property.cs


示例11: IFFChunk

        public IFFChunk(FileReader Reader, GraphicsDevice Device, Iff Parent)
        {
            m_Parent = Parent;
            m_Device = Device;

            ReadHeader(Reader);
        }
开发者ID:Afr0Games,项目名称:Project-Dollhouse,代码行数:7,代码来源:IFFChunk.cs


示例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 ();
        }
开发者ID:osROSE,项目名称:UnityRose,代码行数:29,代码来源:HIM.cs


示例13: ItemReturn

 public ItemReturn(Data data)
 {
     this.data = data;
     resources = data.Resources;
     reader = new FileReader(data);
     writer = new FileWriter(data);
 }
开发者ID:yankri,项目名称:Week7ProjectWeek,代码行数:7,代码来源:ItemReturn.cs


示例14: ReadFileObject

 public void ReadFileObject(FileReader reader)
 {
     Name = reader.ReadString();
     Offset = reader.ReadInt32();
     Size = reader.ReadInt32();
     //reader.BaseStream.Position = Offset;
     //Bytes = reader.ReadByteArray(Size);
 }
开发者ID:dannisliang,项目名称:Unity3D-Disassembler,代码行数:8,代码来源:WebArchiveFile.cs


示例15: BoneBinding

 public BoneBinding(FileReader Reader)
 {
     BoneIndex = Reader.ReadUInt32();
     FirstRealVertexIndex = Reader.ReadUInt32();
     RealVertexCount = Reader.ReadUInt32();
     FirstBlendVertexIndex = Reader.ReadUInt32();
     BlendVertexCount = Reader.ReadUInt32();
 }
开发者ID:Afr0Games,项目名称:Project-Dollhouse,代码行数:8,代码来源:BoneBinding.cs


示例16: GetInstance

 public static FileReader GetInstance()
 {
     if (instance == null)
         {
             instance = new FileReader();
         }
         return instance;
 }
开发者ID:proreco,项目名称:ThunderCat,代码行数:8,代码来源:FileReaderFactory.cs


示例17: TimeProperty

        /// <summary>
        /// Constructs a new TimeProperty instance.
        /// </summary>
        /// <param name="Reader">A FileReader instance used to read a TimeProperty.</param>
        public TimeProperty(FileReader Reader)
        {
            ID = Reader.ReadUInt32();
            uint PropsCount = Reader.ReadUInt32();

            for (int i = 0; i < PropsCount; i++)
                PropertyList.Add(new Property(Reader));
        }
开发者ID:Afr0Games,项目名称:Project-Dollhouse,代码行数:12,代码来源:TimeProperty.cs


示例18: DigitSignature

        private string MESSAGE_HASH_FILE_NAME = "./MessageHash.txt"; // Файл для хранения кэша сообщения

        #endregion Fields

        #region Constructors

        public DigitSignature()
        {
            rsa = new EncryptionAlgorithmsLib.RSA();
            fileReader = new FileReader();
            fileWriter = new FileWriter();
            md5Hash = MD5.Create();
            rsa.GenerateKeys();
        }
开发者ID:ValeriyaSyomina,项目名称:DigitSignature,代码行数:14,代码来源:DigitSignature.cs


示例19: Main

        public static void Main(string[] args)
        {
            var commandParser = new FileReader();
            var input = commandParser.GetPreviousCommand();

            var moduleRunner = new ModuleRunner();
            moduleRunner.Execute(input);
        }
开发者ID:EricFreeman,项目名称:fuck,代码行数:8,代码来源:Program.cs


示例20: Test

        public void Test()
        {
            var file = new FileReader().Read(TestFile);
            if (File.Exists(OutFile)) File.Delete(OutFile);
            new FileWriter().Write(OutFile, file);

            FileAssert.AreSameContents(TestFile, OutFile);
        }
开发者ID:RussPAll,项目名称:ScummToXml,代码行数:8,代码来源:GivenAGameFile.cs



注:本文中的FileReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FileReference类代码示例发布时间:2022-05-24
下一篇:
C# FilePermissions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap