以下哪段代码能把数值516以二进制的形式写入My文件中。
A: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.Save(516);
B: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.write(516);
C: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.Write(516);
D: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.save(516);
A: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.Save(516);
B: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.write(516);
C: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.Write(516);
D: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.save(516);
举一反三
- 以下哪段代码能把数值516以二进制的形式写入My文件中。 A: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.Save(516); B: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.write(516); C: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.Write(516); D: BinaryWriter bw = new BinaryWriter(File.Open("My", FileMode.Create));bw.save(516);
- 若磁盘上己存在某个文本文件,其全路径文件名为d:myfile est.txt,下列语句中不能打开该文件的是______。 A: ifstream file("d:myfile est.txt"); B: ifstream file("d:\myfile\test.txt"); C: ifstream file;file.open("d:\myfile\test.txt"); D: ifstream *pFile=new ifstream("d:\myfile\test.txt");
- Which one of the following is a correct way to create a file for both reading and writing using the function fopen ? A: "ab+" B: "wb+" C: "rb+" D: "ab"
- 如果要对E盘myfile目录下的文本文件abc.txt进行读操作,文件打开方式应为_______________。 A: open("e:\myfile\abc.txt", "r" ) B: open("e:\myfile\abc.txt", "x" ) C: open( "e:\myfile\abc.txt", "rb" ) D: open("e:\myfile\abc.txt", "r+" )
- 如果要对E盘myfile目录下的文本文件abc.txt进行读操作,文件打开方式应为( )。 A: open("e:\\myfile\\abc.txt", "r+" ) B: open( "e:\\myfile\\abtxt", "rb" ) C: open("e:\\myfile\\abc.txt", "r" ) D: open("e:\\myfile\\abc.txt", "x" )