楼主: Lisrelchen
1328 12

[学习资源] 【Exam Ref 70-483】Programming in C# [推广有奖]

11
Lisrelchen 发表于 2017-7-23 07:51:54 |只看作者 |坛友微信交流群
  1. LISTING 4-11 Don’t manually concatenate strings to form a file path
  2. string folder = @”C:\temp”;
  3. string fileName = “test.dat”;
  4. string fullPath = folder + fileName; // Results in C:\temptest.dat
复制代码

使用道具

12
Lisrelchen 发表于 2017-7-23 08:28:29 |只看作者 |坛友微信交流群
  1. LISTING 4-14 Create and use a FileStream
  2. string path = @»c:\temp\test.dat»;
  3. using (FileStream fileStream = File.Create(path))
  4. {
  5.     string myValue = “MyValue”;
  6. byte[] data = Encoding.UTF8.GetBytes(myValue);
  7.     fileStream.Write(data, 0, data.Length);
  8. }
复制代码

使用道具

13
escaflowne1985 在职认证  发表于 2017-11-10 12:51:38 |只看作者 |坛友微信交流群
能否说明下 代码内容表达是什么意思么?

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-23 22:59