ASP. NET is also implemented like a WinForm Program

Source: Internet
Author: User

As there are fewer and fewer people who will use WinForm now, they may have to use ASP when doing something small. NET (friends who like the console should not pin). If so, the tragedy will happen: A small tool (or a small demo project), and send it to friends, I don't want people to install IIS or VS20XX, do they? Without these two tools, such gadgets are really inconvenient to run. What should I do? Anyone who has done ASP. NET development knows that the website is usually deployed to iisto directly run the program. Of course, you do not need to use vsto open the project and use webdev.webserver.exe with vsto start the program. This method is inconvenient.

I usually like to write some gadgets. Fortunately, I will use WinForm, so this problem can be solved. However, this problem also occurs when I want to use some small website files to others. Finally, I made a very convenient tool to completely solve the problem that ASP. NET websites cannot run like WINFORM. Today, I will show you thisGadgets(It is very small, less than 300 K), I believe you will like it.

Remember, the name of my tool is:FishAspnetLoader

Operation Method

The tool is not easy to use, and the ease of use of operations is critical. Let's see how my tool starts a website.

In Windows Resource Manager, find the directory of the website you want to start and right-click, for example:

Click [load this directory as a website with FishAspnetLoader.

Yes, I am not wrong, so that we can, any directory can, and you do not need to copy any files to any place ,【Just right-click and click the menu.].

The website runs as follows:

Are you running a WinForm program?

What are you talking about? Let's take a look:

Now it's like a WinForm program.

Supported ASP. NET program categories

As mentioned above, this tool is designed to solve the problem of restrictions on ASP. NET program running. This tool supports WebForm and mvc asp. NET frameworks. My WEB framework is also supported.

Therefore, theoretically, as long as an ASP. NET program is used, it can be run and automatically recognized by the program without any configuration. Or that sentence: [just right-click the mouse and click the menu ].

In addition, the ASP. NET version is not a problem, from. net 2.0 to. net 4.0.

It is also an HTTP server

As I mentioned earlier, my tools support right-clicking on any folder and loading it as a website. Yes, I'm not talking about it, even if the directory is not an ASP. the NET program directory is a common file directory or a static webpage directory. At this time, it is the same as the IIS behavior. If the request is a static page, the static page is displayed. When a directory is encountered, the directory is listed. In addition, the running speed is faster than that of ASP. NET. The reason is simple:At this time, the ASP. NET runtime environment is not loaded.

Directory of the columns:

Another thing to add: Unlike webdev.webserver.exe, as long as it is a file name or directory name supported by Windows, my tool can support it, which is consistent with the behavior of IIS.

Sorry, I haven't done that kind of pure Static Page website for a long time, so I won't show it. I think you understand.

Support remote machine access

If someone asks me for a file later, I will ask them to download it. This is more secure than the shared directory.

Haha, if you have such an idea, I would like to congratulate you. Your security awareness is good. Yes, my tool supports this function: allows remote machines to browse [directory loaded as a website] (not any directory ).

For the sake of security, the program does not allow remote machine connection by default, and you need to open it manually. The operation is also simple, such:

In the text description, right-click the system tray icon and click the set security parameters menu. The following dialog box is displayed:

This dialog box is very simple. I want you to understand it. It contains 78 words .....

Not limited by Windows Firewall

When talking about how to allow remote machine access, there is a problem: since Windows XP, the operating system has integrated the firewall function, and a lot of machines have opened this function. If this is the case, the aforementioned functions may encounter problems: they may be blocked by the firewall! Oh, this tool is too imperfect. How can someone else not be blocked by the firewall? Fortunately, my tool is not troubled by this problem. It can automatically add it to the Windows Firewall exception list without interrupting your operations.

Windows 7 firewall also supports:

Respect everyone's operation habits

I pay more attention to Operation Experience, and my tools also have good support for this idea. It started from the moment I started my website.

When you load a directory as a website, the following dialog box appears, asking you how to select a browser to browse the website:

Note that there is a small check mark below, which is sometimes very convenient.

Even if you select a browser, it is easy to change the browser later. See:

In the text description, right-click the system tray icon and click the select browser menu. The following dialog box is displayed:

You can still select another browser. I have installed five browsers. How many Browsers Do you have installed?

Built-in multi-label browser support

My little tool, which has a built-in multi-label browser (IE kernel), even if you have only installed IE6 on your machine, you can still enjoy the multi-label function. There are two ways to switch:

Note: Click the close button in the upper-right corner of the window. The program is not completely exited.To exit the program, right-click the drag icon and click the exit menu.

In addition, you can right-click the taskbar to exit the program in the built-in browser working mode. For example (it seems that Windows 7 is not supported ):

Startup parameters and configuration files

To provide some user-friendly support, I can set some startup parameters at startup.Start Windows from the Start Menu,The startup interface is as follows:

Note: After you set the relevant startup parameters, you can save them. The "Save as" button is displayed on the dialog box. In this case, the program will save these parameters as a siteconfig file.

A siteconfig file can save the configuration parameters required by a website at startup FishAspnetLoader.

For ease of operation, you can save the configuration parameters of frequently browsed websites or directories to a siteconfig file.

When you right-click the menu in the resource manager folder or pass a directory from the command line,

FishAspnetLoader checks whether the directory configuration exists in the installation directory,

If no configuration file exists in the target directory,

If you do not have any configuration files in the my documents directory.

If a configuration file is found, read the configuration file.

When you start FishAspnetLoader from the Start menu, the program displays the "set startup parameters" dialog box.

If you just browse a fixed directory or local website, you can save the current settings as a file named: default. siteconfig.

Or, if the website is published as a tool, you can prepare the file in advance. This dialog box will not appear in the future.

When you pass a directory path from the "Resource Manager" right-click menu or command line, and no configuration for this directory is found,

FishAspnetLoader checks whether there is web. config in that directory. If this file exists, it loads Asp.net Runtime. Otherwise, it is not loaded to speed up startup.

If this method is not applicable to a directory, start FishAspnetLoader from the "Start Menu" and create a siteconfig file for this directory to specify the appropriate parameters.

The STARTUP configuration file is designed to allow you to better customize the program running behavior. I provide some parameters to make the website better pretend to be a common desktop program in a built-in browser.

In addition, the tool also supports the command line Startup Mode and can receive a siteconfig file. You only need to write a batch and run the batch processing when installing the installation package.

Or refer to the shortcut of the installation package of another tool. The startup command line of that tool is simpler.

You can also refer to the configuration file of this demo.

To make it easier for you to use this tool.

Supports. NET 4.0

Note:To run this program, only. net Frarmework 2.0 is required.

However, if the website you want to run is based on ASP. NET 3.5, you need to install. net 3.5. To run. net 4.0 websites, install. net 4.0.

If you have installed. net framework 4.0 on your machine and want to enable. net 4 support.

You only need to rename the file fishaspnetloader.exe.config.bak.pdf under the installation directory to fishaspnetloader.exe. config.

Deployment Problems

At the end of this article, I provide the installation package for this tool. The installation package also contains some other files. The installation package is provided to make it easier for you to use my tools.

In your installation package, and provide a siteconfig file, and then start my tool as a command line. For more information, see my blog:

Shows and downloads a comprehensive example of the common data access layer and Ajax Server framework.

A database auxiliary tool: My-SqlViewer

Package and download the above software

Original article: cnblogs.com fish-li

Related Article

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.