从读取文本文件说php 和 C#
2008-06-05  作者:amao  同分类文章
description:
我总算知道为什么java在web方面干不过php了。

php就是简单得好,在这个追求开发效率而不是程序运行效率的年代,php就一个函数 file_get_contents — Reads entire file into a string
再看看msdn里面的c#

using System;

using System.IO;
public class TextFromFile
{
private const string FILE_NAME = "MyFile.txt";
public static void Main(String[] args)
{
if (!File.Exists(FILE_NAME))
{
Console.WriteLine("{0} does not exist.", FILE_NAME);
return;
}
using (StreamReader sr = File.OpenText(FILE_NAME))
{
String input;
while ((input=sr.ReadLine())!=null)
{
Console.WriteLine(input);
}
Console.WriteLine ("The end of the stream has been reached.");
sr.Close();
}
}


太过繁琐,不如php的简练。所以我发现自己还是喜欢php多一点。除非是很关心运行效率的地方。


相关
组图:《AV事务所》将播 破禁解构日本AV文化
昆明至北京西K472/471次火车时刻表
先序序列和中序序列可唯一确定一棵二叉树
P2P网络电视台Joost融资4500万美元
RJ45水晶头-网线制作方法(图。文)
甲骨文IBM等巨头联手在日本推销Linux
[游戏]波斯猴子出了 ^o^
民进党2008大选候选人谢长廷简历(履历)
从读取文本文件说php 和 C#
Google AdSense发布者可以在账号停止后依然可能收到应得的款项