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