<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Takachan</author_name>
  <author_url>https://blog.hatena.ne.jp/Takachan/</author_url>
  <blog_title>PG日誌</blog_title>
  <blog_url>https://takap-tech.com/</blog_url>
  <categories>
    <anon>C#</anon>
  </categories>
  <description>C#でファイル操作するときはStream系のクラスを使用します。どんなに小さいファイルであってもたいてい以下のようなコードになるのですが若干記述量が多いのが気になります。 public static void Main(string[] args) { using(var sr = new StreamReader(@&quot;hogehoge&quot;)) { while ((line = sr.ReadLine()) != null) { // 何らかの処理 } } } そこで、単純な操作しかしない場合、Fileクラスに便利な機能が存在しているので、その紹介をしたいと思います。 ファイルの内容を全部読み取…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakap-tech.com%2Fentry%2F2018%2F04%2F27%2F072200&quot; title=&quot;C#で簡単なファイル操作を行う - PG日誌&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/T/Takachan/20170920/20170920004006.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-04-27 07:22:00</published>
  <title>C#で簡単なファイル操作を行う</title>
  <type>rich</type>
  <url>https://takap-tech.com/entry/2018/04/27/072200</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
