VB大作业(各种小程序编程).doc

  1. 1、本文档共17页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
VB大作业(各种小程序编程).doc

一、鸟巢绘制 Private Sub Form_Click() Cls Dim r, xi, yi, xj, yj, x0, y0, aif As Single r = Form10.ScaleHeight / 2 x0 = Form10.ScaleWidth / 2 y0 = Form10.ScaleHeight / 2 n = 16 aif = 3.14159 * 2 / n For i = 1 To n xi = r * Cos(i * aif) + x0 yi = r * Sin(i * aif) + y0 For j = i To n xj = r * Cos(j * aif) + x0 yj = r * Sin(j * aif) + y0 Line (xi, yi)-(xj, yj), QBColor(i - 1) PSet (xi, yi) Print i - 1 Next j Next i End Sub Private Sub Form_Load() Print 要求: ; Print 1.将圆周等分成16份; Print 2.每个等分点要标记成0-16的数字; Print 3.按样本图的图案画图。 End Sub 附图: 二、加密 Function code(ByVal s$, ByVal key%) Dim c As String * 1, iAsc% code = For i = 1 To Len(s) c = Mid$(s, i, 1) Select Case c Case A To Z iAsc = Asc(c) + key If iAsc Asc(Z) Then iAsc = iAsc - 26 code = code + Chr(iAsc) Case a To z iAsc = Asc(c) + key If iAsc Asc(z) Then iAsc = iAsc - 26 code = code + Chr(iAsc) Case Else code = code + c End Select Next i End Function Private Sub close_Click() Form11.Hide Form1.Show End Sub Private Sub Jiami_Click() Text2 = code(Text1, 2) End Sub Private Sub open_Click() CommonDialog1.Action = 1 Text1.Text = Open CommonDialog1.FileName For Input As #1 Dim counter As Integer Dim workarea(25000) As String ProgressBar1.min = LBound(workarea) ProgressBar1.max = UBound(workarea) ProgressBar1.Visible = True ProgressBar1.Value = ProgressBar1.min For counter = LBound(workarea) To UBound(workarea) workarea(counter) = initial value counter ProgressBar1.Value = counter Next counter Do While Not EOF(1) Line Input #1, inputdata Text1.Text = Text1.Text + inputdata + vbCrLf Loop Close #1 End Sub Private Sub save_Click() CommonDialog1.FileName = a1.txt CommonDialog1.DefaultExt = txt CommonDialog1.Action = 2 Open CommonDialog1.FileName For Output As #1 Print #1, Text2.Text Close #1 End Sub 三、解密 Function UnCode(ByVal s$, ByVal key%) Dim c As String * 1, iAsc% UnCode = For i = 1 To Len(s) c = Mid$(s, i, 1) Select Case c Case A To Z iAsc = Asc(c) - key

文档评论(0)

tangtianxu1 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档