问答题


【参考答案】

[解析] 时钟控件作用是以一定的时间间隔激发计时器事件(Timer)而执行相应程序代码,Interval属性决定时间间隔......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
热门 试题

问答题
[解析] 文本框中显示的内容由Text属性设置。单击命令按钮触发Click事件,命令按钮的标题由Caption属性设置。 题目要求加密原理是:在原来字符的ASCII码加上一个整数(题目要求为B)转换为其他的字符,然后再将加密后的字符显示在文本框中。这样就用到了Chr函数和Asc函数。 Chr函数返回String,其中包含有与指定的字符代码相关的字符。其语法格式为: Chr(charcode) charcode必要参数,是一个用来识别某字符的Long。 Asc函数返回一个Integer,代表字符串中首字母的字符代码。其语法格式为: Asc(string) string必要的参数,可以是任何有效的字符串表达式。解题步骤: 第一步:编写程序代码。 程序提供的代码: Private Sub CA_Click() Dim strinfo As String ’ inG.txt For Input As A Input #A, strinfo Close #A TextA.Text=strinfo End Sub Private Sub CommandB_Click() Dim strchange As String Dim i As Integer For i=A To Len(TextA.Text) ’ strchange=strchange+(Asc(Mid(TextA.Text, i, A) ) +B) Next TextA.Text=strchange End Sub Private Sub CommandC_Click() Open outG.txt For Output As A ’Print #A, Close #A End Sub 参考代码: Private Sub CA_Click() Dim strinfo As String Open inG.txt For Input As A Input #A, strinfo Close #A TextA.Text=strinfo End Sub Private Sub CB_Click() Dim strchange As String Dim i As Integer For i=A To Len(TextA.Text) strchange=strchange+Chr(Asc(Mid(TextA.Text, i, A) ) +B) Next TextA.Text=strchange End Sub Private Sub CC_Click() Open outG.txt For Output As A Print #A, TextA.Text Close #A End Sub 第二步:调试并运行程序 第三步:按题目要求存盘