惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cybersecurity and Infrastructure Security Agency CISA
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
量子位
Hugging Face - Blog
Hugging Face - Blog
罗磊的独立博客
小众软件
小众软件
T
Tailwind CSS Blog
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Exploit Database - CXSecurity.com
T
Tenable Blog
博客园 - 叶小钗
宝玉的分享
宝玉的分享
P
Privacy International News Feed
T
Tor Project blog
博客园_首页
AWS News Blog
AWS News Blog
雷峰网
雷峰网
C
Cisco Blogs
Help Net Security
Help Net Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 【当耐特】
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
K
Kaspersky official blog
人人都是产品经理
人人都是产品经理
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Schneier on Security
博客园 - Franky
W
WeLiveSecurity
L
LINUX DO - 热门话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Proofpoint News Feed
大猫的无限游戏
大猫的无限游戏
腾讯CDC
L
Lohrmann on Cybersecurity
J
Java Code Geeks
美团技术团队
博客园 - 司徒正美
The Cloudflare Blog
V
V2EX

博客园 - Eric.Chai

在WebService中不能返回SqlDataReader 控件生命周期 Solution:TF10216: Team Foundation services are currently unavailable SelectedValue小技巧 web.config点滴:更改login控件对密码安全性的要求 ASP.NET2.0网站配置的数据库连接失败问题 什么是LINQ? MSCRM自动填写当前时间 DIV和SPAN的区别 MSCRM3.0备份与还原 MSCRM IFrame 应用 关于界面元素的隐藏 ASP.NET(c#)实现防止同一用户同时登陆 “奇怪”的数据类型 简体中文转换繁体中文 使用数组动态赋值SQL IN ()条件 DatSet与DataTable的关系 SharePoint Server 2007 Web内容管理中的几个关键概念 英语面试题 --Algorithms
C#读文本文件
Eric.Chai · 2008-03-06 · via 博客园 - Eric.Chai

问题:
有一文本文件,内容如下:
XZHG01            2007-01-14  01:00:12  SU
请问如何用C#把2007-01-14这个信息读取出来啊

回答:
/*
using System.IO;

StreamReader sr = new StreamReader("YourFileName", System.Text.Encoding.GetEncoding("GB2312"));

String s = sr.ReadToEnd();

sr.Close();
*/

string str = "XZHG01            2007-01-14  01:00:12  SU";
string[] strArr = ss.Split(' ');
for (int i = 0; i < strArr.Length; i++)
   {
                string s = strArr[i];
                if (s.Contains("2007"))
                {
                    Console.Write(s);
                }
   }