/// <summary>
/// This method opens a file using System.IO classes and the
/// TitleLocation property. It presumes that a file named
/// ship.dds has been deployed alongside the game.
/// </summary>
private static void DoOpenFile()
{
    try
    {
         System.IO.Stream stream = TitleContainer.OpenStream("aa.txt");
         System.IO.StreamReader sreader = new System.IO.StreamReader(stream);
        // use StreamReader.ReadLine or other methods to read the file data

Console.WriteLine("File Size: " + stream.Length);
        stream.Close();
    }
    catch (System.IO.FileNotFoundException)
    {
         // this will be thrown by OpenStream if gamedata.txt
        // doesn't exist in the title storage location
     }
}

最新文章

  1. 检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005
  2. 通过寄生组合式继承创建js的异常类
  3. python 赋值、表达式
  4. [ASE][Daily Scrum]11.30
  5. mysql中insert into select from的使用
  6. mysql-窗口多表连接视图view
  7. 【深入Java虚拟机】之一:Java内存模型与内存溢出
  8. IT人士感言2(转)
  9. centos下vsftpd安装与配置
  10. golang与C交互:cgo
  11. Linux客户/服务器程序设计范式2&mdash;&mdash;并发服务器(进程池)
  12. Android 自定义View修炼-自定义加载进度动画XCLoadingImageView
  13. Git &amp; Github 一页简明笔记(转)main
  14. geom设置—折线图
  15. 微信小程序支付简单小结与梳理
  16. 关于html5调用手机相机(原创)
  17. python内置函数(四)
  18. java常用类--字符串
  19. 使用jQuery增加或删除元素(内容)
  20. VUE中/deep/深度作用域

热门文章

  1. C#开源类库
  2. 一款基于jQuery的支持鼠标拖拽滑动焦点图
  3. Disable right click on the website
  4. IIS 之 打开/关闭 Internet 信息服务
  5. ScriptTransformer
  6. Java基础知识强化之IO流笔记76:NIO之 Channel(通道)之间的数据传输
  7. JavaScript中交换两个变量的值得三种做法(代码实现)
  8. 【Python千问 2】Python核心编程(第二版)-- 欢迎来到Python世界
  9. iOS中的加密方式 与 文件解压缩
  10. UITabBarItem编写的时候出现得图片显示异常,和有一些比较忽略的方法总结