unity 读取文本与写入文本
void writeData(string str,string file)
{
string parth = Application.dataPath;
StreamWriter streamWriter;
FileInfo fi = new FileInfo(parth+file);
if (!fi.Exists)
streamWriter = fi.CreateText();
else
streamWriter = fi.AppendText();
streamWriter.WriteLine(str);
streamWriter.Close();
streamWriter.Dispose();
}
ArrayList loadfile(string path,string name)
{
StreamReader sr = null;
try{
sr = File.OpenText(name);
}catch{}
string line;
ArrayList arra = new ArrayList();
while((line = sr.ReadLine())!= null)
{
arra.Add(line);
}
sr.Close();
sr.Dispose();
return arra;
}
unity 读取文本与写入文本的更多相关文章
- python:创建文件夹:写入文本1:读取txt:读取Excel文件遍历文件夹:
https://blog.csdn.net/u011956147/article/details/80369731 创建文件夹: import osimport shutil def buildfil ...
- 关于 MAXScript 逐行写入文本
官方帮助文档FileStream Values部分有相关介绍. fn format_txt filepath filetext = ( if doesFileExist filepath == tru ...
- C#异步将文本内容写入文件
在C#/.NET中,将文本内容写入文件最简单的方法是调用 File.WriteAllText() 方法,但这个方法没有异步的实现,要想用异步,只能改用有些复杂的 FileStream.WriteAsy ...
- python中文输出和写入文本
中文输出 #-*-coding:utf8-*- import requests import re timeout = 8 headers = {'User-Agent':'Mozilla/5.0 ( ...
- Asp.net 定时写入文本记录
Asp.net 定时写入文本记录 public static string FileAddress = "c:\\TimerLog.txt"; protected void Pag ...
- Unity 读取、写入自定义路径文件,调用System.Windows.Forms
调用System.Windows.Forms DLL 首先在Unity新建Plugins文件夹添加System.Windows.Forms.dll 然后代码中添加引用 using System; us ...
- C# 下载文件 删除文件 写入文本
由于经常用到文件处理,便自己封装了下 分享给大家. 包含写入文本 批量删除文件 下载文件 .--可直接使用 /// <summary> /// 写入到txt /// </summ ...
- Python3.x:自动生成IP写入文本
Python3.x:自动生成IP写入文本 ''' 生成ip写入文件 ''' import time time_start = time.time() #参数:number-生成条数:start-开始i ...
- linux的fwrite()使用方法,当前时间写入文本的程序
fwrite函数 1.函数功能 用来读写一个数据块. 2.一般调用形式 fwrite(buffer,size,count,fp); 3.说明 (1)buffer:是一个指针,对fread来说,它是读入 ...
随机推荐
- Surprise团队第二周项目总结
Surprise团队第二周项目总结 项目进展 已实现五子棋人人模式部分 人人模式: 基本方式:采取黑棋先行,黑白交替的下棋顺序. 模式:通过鼠标点击相应棋盘中的"交叉点",在lay ...
- template 不能分别在.h和.cpp中定义模板
先上代码: #ifndef SEQLIST_H #define SEQLIST_H #include <iostream> ; template <typename type> ...
- rigidbody2D.velocity 提示缺少using?用的unity5?
请用 GetComponent<Rigidbody2D>().velocity
- ✡ leetcode 173. Binary Search Tree Iterator 设计迭代器(搜索树)--------- java
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the ro ...
- SDWebImage
SDWebImage 加载图片的流程 入口 setImageWithURL:placeholderImage:options: 会先把 placeholderImage 显示,然后 SDWebImag ...
- Enum.GetHashCode()的问题
先说一下,正常如果代码可以定义成枚举,我是比较倾向于定义成枚举的,类似这样: public enum Gender { /// <summary> /// 男 /// </summa ...
- 统计一下ie的一些问题(什么时候遇到什么时候更新)
1.document.createElement问题 问题描述:在用ASP.NET的时候,通常我们需要注册脚本,通常是以这种形式发送到客户端: <script type="text/j ...
- tcpdf最新版 6.2版
tcpdf6.2版,地址记 录 http://download.csdn.net/detail/hayywcy/9547873
- (转) How to Train a GAN? Tips and tricks to make GANs work
How to Train a GAN? Tips and tricks to make GANs work 转自:https://github.com/soumith/ganhacks While r ...
- 简介 – ASP.NET MVC 4 系列
正所谓好记性不如烂笔头,尤其是技术类书籍在阅读后,时间久了一定会忘记.而重新翻阅整本书也较为低效,遂以博客记录阅读摘要以供日后查阅.本系列文章均摘要自 Wrox 红皮书[ASP.NET ...