首页 > 代码库 > Cnic.Snippet
Cnic.Snippet
<?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>usingSR</Title> <Shortcut>usingSR</Shortcut> <Description>StreamReader 循环的代码段</Description> <Author>Microsoft Corporation</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> <SnippetType>SurroundsWith</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>path</ID> <ToolTip>路径</ToolTip> <Default>@""</Default> </Literal> </Declarations> <Code Language="csharp"><![CDATA[ using (StreamReader sr = new StreamReader($path$)) { string line = sr.ReadLine(); while (line != null) { $end$ line = sr.ReadLine(); } }]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>
<?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>usingSW</Title> <Shortcut>usingSW</Shortcut> <Description>StreamWriter 循环的代码段</Description> <Author>Microsoft Corporation</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> <SnippetType>SurroundsWith</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>path</ID> <ToolTip>路径</ToolTip> <Default>@""</Default> </Literal> <Literal> <ID>msg</ID> <ToolTip>msg</ToolTip> <Default>""</Default> </Literal> </Declarations> <Code Language="csharp"><![CDATA[ using (StreamWriter sw = new StreamWriter($path$) { sw.WriteLine($msg$); $end$ }]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。