创建Windows窗体应用程序需要多少个控件 [英] How Many Controls Are Required To Create A Windows Form Application

查看:63
本文介绍了创建Windows窗体应用程序需要多少个控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
假设您获得了VB.net代码[计算MD5校验和]的示例代码

Hi All.
Say you are given a sample code of a VB.net code [to calculate MD5 Checksum]

Imports System.IO
    Imports System.Text
    Imports System.Diagnostics
    Imports System.Security.Cryptography
    
    Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    Dim stopwatch As New Stopwatch
    Dim md5 As String = ""
    stopwatch.Start()
    md5 = GetMD5Checksum("C:\windows\explorer.exe")
    stopwatch.Stop()
    MsgBox("MD5 Checksum [" + md5 + "]" & Environment.NewLine & _
    "Computed in " + stopwatch.Elapsed.ToString)
    End Sub 'Button1_Click

    Public Function GetMD5Checksum(ByVal filePath As String) As String
    Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider
    Dim fs As FileStream = New FileStream(filePath, FileMode.Open, _
    FileAccess.Read, FileShare.Read, 8192)
    fs = New FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
    md5.ComputeHash(fs)
    fs.Close()
    Dim hash As Byte() = md5.Hash
    Dim sb As StringBuilder =NewStringBuilder
    Dim hByte As Byte
    For Each hByte In hash
    sb.Append(String.Format _
    	 "{0:X2}", hByte))
    Next
    Return sb.ToString()
    End Function 'GetMD5Checksum



如果给了我们这些代码,而我只想创建一个Windows窗体应用程序,那么我怎么可能猜到需要多少控件(即按钮,文本框,OpenFileDialog等)而又不丢失任何元素?有什么办法可以做这种反向技术吗?

非常感谢,
Giggsey



If we are given the codes and I just want to create a Windows Form Application, then how can I possibly guess how many controls are required i.e. buttons, textbox, OpenFileDialog, etc without missing an element? Is there any way to go about doing this reverse technique?

Many thanks,
Giggsey

推荐答案

创建Forms应用程序,您需要至少具有一个控件—一个主表单(System.Windows.Forms.Form实例是一个控件,System.Windows.Forms.Control ).

其他一切取决于您的要求.

—SA
The create a Forms application, you are required to have at least one control — a main form (a System.Windows.Forms.Form instance is a control, System.Windows.Forms.Control).

Everything else depends on your requirements.

—SA


这篇关于创建Windows窗体应用程序需要多少个控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆