My recommendation: Search for Apps in vb.net

Source: Internet
Author: User
Tags comments functions reference reflection
Summary

Almost all developers who have used Visual Basic 6 have used the object of the app, which is powerful and well known, then Visual Basic. Is there a similar object in net? The following will be explained further.


--------------------------------------------------------------------------------

Directory

1. App Introduction

2. Looking for similar functions in vb.net

3. Simple example

4. Summary


--------------------------------------------------------------------------------

1. App Introduction

In Visual Basic 6, the app is a global object that can be accessed directly from the App keyword. The App object can get the current application of the title, version, path, execution file name and other information, and can be used to determine whether the previous instance of the application is running. App objects no longer exist in vb.net, but we can still use other objects from vb.net to get the same functionality from the app.


--------------------------------------------------------------------------------

2. Looking for similar functions in vb.net

The comments properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( System.Reflection.Assembly.GetExecutingAssembly.Location). Comments Property

The CompanyName properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( System.Reflection.Assembly.GetExecutingAssembly.Location). CompanyName Property

The EXEName property of the app in original Visual Basic 6 resembles the Vb6.getexename property in Visual Basic. NET

The FileDescription properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( System.Reflection.Assembly.GetExecutingAssembly.Location). FileDescription Property

The HelpFile property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The HInstance property of the app in original Visual Basic 6 resembles the Vb6.gethinstance property in Visual Basic. NET

The Legalcopyright properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( System.Reflection.Assembly.GetExecutingAssembly.Location). Legalcopyright Property

The Legaltrademarks properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( System.Reflection.Assembly.GetExecutingAssembly.Location). Legaltrademarks Property

The LogEvent method of the app in original Visual Basic 6 has no similar method in Visual Basic. NET

The LogMode property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The LogPath property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The major properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( System.Reflection.Assembly.GetExecutingAssembly.Location). Filemajorpart Property

The minor properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( system.reflection.assembly.getexecutingassembly.-Location). Fileminorpart Property

The NonModalAllowed property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Olerequestpendingmsgtext property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Olerequestpendingmsgtitle property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Olerequestpendingtimeout property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Oleserverbusymsgtext property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Oleserverbusymsgtitle property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Oleserverbusyraiseerror property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Oleserverbusytimeout property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The Path property of the app in original Visual Basic 6 resembles the Vb6.getpath property in Visual Basic. NET

The PrevInstance properties of the app in original Visual Basic 6 resemble UBound in Visual Basic. NET (Diagnostics.Process.GetProcessesByName Diagnostics.Process.GetCurrentProcess.ProcessName) > 0 Expressions

The ProductName properties of the app in original Visual Basic 6 resemble the System.Diagnostics.FileVersionInfo.GetVersionInfo in Visual Basic. NET ( System.Reflection.Assembly.GetExecutingAssembly.Location). ProductName Property

The Retainedproject property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The revision property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The StartLogging method of the app in original Visual Basic 6 has no similar method in Visual Basic. NET

The StartMode property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The TaskVisible property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The ThreadID property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET

The title property of the app in original Visual Basic 6 resembles the System.Reflection.Assembly.GetExecutingAssembly.GetName.Name property in Visual Basic. NET

The Unattendedapp property of the app in original Visual Basic 6 has no similar properties in Visual Basic. NET


--------------------------------------------------------------------------------

3. Simple example

Here for the current application path as an example, first reference the VisualBasic.Compatibility namespace, click the References item in the main menu "project", and select "Microsoft Visual Basic. NET compatibility Runtime "




The Microsoft.VisualBasic.Compatibility namespace appears in the reference to the project list.




Enter code in the new console project


Imports Microsoft.VisualBasic.Compatibility

Module Module1
Sub Main ()
Console.WriteLine (VB6. GetPath)
End Sub
End Module


The results are still the same as the results of the App.Path using VB6.


--------------------------------------------------------------------------------

4. Summary

VB6 programmers can easily apply these properties or methods similar to the app. NET.


--------------------------------------------------------------------------------


Author: Meng Qingxin





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.