问题 单项选择题

在窗体上画一个通用对话框,其名称为CommonDialogl,然后画一个命令按钮,并编写如下事件过程。
Private Sub Command1_Click()
CommonDialog1.Flags=vbOFNHideReadOnly
CommonDialog1.Filter="All Files(*.*)|*.*|Text Files(*.txt)|*.txt
CommonDialog1.FilterIndex=1
CommonDialog1.ShowOpen
MsgBox CommonDialog1.FileName
End Sub
程序运行后,单击命令按钮,将显示一个“打开”对话框,此时在“文件类型”框中显示的是

A.All Files(*.*)

B.Text Files(*.txt)

C.*.txt

D.All Files(*.*)|Text Files(*.*)

答案

参考答案:A

解析:[命题目的] 考查考生对通用对话框的熟悉程度。
[解题要点] 通用对话框控什的CommonDialogl的 Filter属性用来指定在对话框中显示的文件类型。利用该属性可以设置多个文件类型,供用户在对话框的“文件类型”的下拉列表中选择。Filter的属性值由一对或多对文本字符串组成,每对字符串用管道符“|”隔开,在管道符“|”前面的部分称为描述,后面的部分一般为通配符和文件扩展名,称为“过滤器”。如“*.txt”等,各对字符串之间也用管道符隔开。其格式如下:
[窗体.]对话框名.Filter=“描述符1|过滤器1|描述符2|过滤器2……”
如果省略窗体,则为当前窗体。本题执行语句后,可以在文件类型栏内通过下拉列表选择要显示的文件类型,而最初默认显示的文件类型(过滤器)可以由 FilterIndex属性来指定,该属性是一个整数。用Filter属性设置多个过滤器后,每个过滤器都有一个值,第1个过滤器的值为1,第2个过滤器的值为2……,用FilterIndex属性可以指定作为默认显示的过滤器,本题中的值是1,所以显示All Files(*.*)。
[错解分析] 通用对话框的Filter属性是用来显示打开和保存文件类型的。
[考点链接] 通用对话框的FileName属性和DilogTitle属性的作用。

阅读理解

阅读理解。

     In 1901,H. G. Wells, an English writer, wrote a book describing a trip to the moon. When the

explorers landed on the moon, they discovered that the moon was full of underground cities. They

expressed their surprise to the "moon people" they met. In turn, the "moon people" expressed their

surprise. "Why," they asked, "are you traveling to outer space when you don't even use your inner

space?"

     H.G. Wells could only imagine travel to the moon. In 1969, human beings really did land on the

moon. People today know that there are no underground cities on the moon. However, the question

that the "moon people" asked is still an interesting one. A growing number of scientists are seriously

thinking about it.

     Underground systems are already in place. Many cities have underground car parks. In some cities,

such as Tokyo, Seoul and Montreal, there are large underground shopping areas. The "Channel",a

tunnel connecting England and France, is now complete.

     But what about underground cities? Japan's Taisei Corporation is designing a network of underground

systems, called "Alice Cities". The designers imagine using surface space for public parks and using

underground space for flats, offices, shopping, and so on. A solar dome would cover the whole city.

     Supporters of underground development say that building down rather than building up is a good way

to use the earth's space. The space, they say, can be used for farms, parks, gardens, and wilderness. H.G. Wells "moon people" would agree. Would you?

1. The explorers in H.G. Well's story were surprised to find that the "moon people"       .

A. knew so much about the earth        

B. understood their language

C. lived in so many underground cities    

D. were ahead of them in space technology

2. What sorts of underground system are already here with us?

A. Offices, shopping areas, power stations  

B. Tunnels, car parks, shopping areas

C. Gardens, car parks, power stations      

D. Tunnels, gardens, offices

3. What would be the best title for the text?

A. Alice Cities-cities of the future      

B. Space travel with H.G. Wells

C. Enjoy living underground

D. Building down, not up

单项选择题 案例分析题