In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to prohibit downloading files on the Internet in VB.NET. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Friends who often go to Internet cafes know that some Internet cafes cannot download things, and we now use VB.NET programming to achieve this function. But anyone who knows a little bit about computers can go back to the IE settings and change it to allow downloads. After studying the registry, I found a way to forbid downloading, that is, to write a Mini Program using VB.NET. By modifying some items in the registry, the download function of IE browser is completely prohibited, and all methods of modifying the registry are blocked.
First, VB.NET programming starts VB6.0 and creates a new project, named DENYDOWN
Second, VB.NET programming to modify the registry there are two ways: one is to establish a .REG extension of the file, double-click automatically added to the registry (in the program is through the WINDOWS with a registry editor REGEDIT.EXE to import it into the registry, to modify the registry purpose); the other is to modify the registry by calling the WINDOWS API function. The two methods have their own advantages and disadvantages, and we combine them here and use them together to achieve the purpose of modifying the registry. Since we are going to call the WINDOWS API function, we first declare the following four API functions in the declaration bar: open the subkey RegOpenKey, delete the subkey RegDeleteKey, close the open subkey RegCloseKey and refresh the subkey function RegFlushKey, and have a constant declaration: HKEY_LOCAL_MACHINE. The declaration name is as follows:
Private Declare Function RegDeleteKey Lib "advapi32.dll" Alias _ "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long Private Declare Function RegOpenKey Lib "advapi32.dll" Alias _ "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As_ Long Private Const HKEY_LOCAL_MACHINE = & H80000002 Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As_ Long Private Declare Function RegFlushKey Lib "advapi32.dll" (ByVal hKey As Long) As_ Long
Third, VB.NET programming in the Form_Load event process to enter the following content, for the convenience of the following description, here to add a label to each line, of course, the actual programming can not be labeled.
In order to allow this program to close automatically after each modification of the registry, it is also necessary to add the following exit program.
Private Sub Form_GotFocus () Unload Me End Sub
Generate DenyDown.exe, copy it to C:\ PROGRAM FILES\ DenyDownLoad\, and everything will be OK. Of course, you also need a program to restore changes, otherwise even we can not download files and modify the registry, through the above procedures, I believe you should be able to write a program to restore changes, I will not repeat here.
This is the end of the article on "how to prohibit downloading files on the Internet in VB.NET". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.