Category:ASP.NET

  • Beautify WinForm controls with redraw items

    Time:2020-12-1

    If you feel that combobox, listbox or other WinForms controls in the project cannot meet your display requirements, many controls, including forms, support redrawing and modifying display styles. The following example completes the redrawing of combox data items, hoping to play an important role. Show source code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; […]

  • asp.net An example of MVC webapi interface encryption method

    Time:2020-11-30

    In many projects, because webapi is open to the outside world, at this time, we have to consider the security of interface exchange data. There are also many security mechanisms. For example, when Andriod and webapi exchange data, the two-way certificate method can be used, but the development cost is relatively high, Today we are […]

  • ASP.NET Detailed explanation of application example of value transfer between pages

    Time:2020-11-29

     Application The application variable is valid throughout the application life cycle, similar to using global variables, so it can be accessed in different pages. It differs from session variable in that the former is a global variable shared by all users, while the latter is a unique global variable for all users.   For example: […]

  • ASP.NET Problems and solutions of middleware with initial parameters in core 2.0

    Time:2020-11-28

    problem How to ASP.NET Core 2.0 passes initial parameters to middleware? answer In an empty project, create a poco (plain old CLR object) to save the required parameters of middleware: public class GreetingOptions { public string GreetAt { get; set; } public string GreetTo { get; set; } } Add a middleware: public class GreetingMiddleware […]

  • . net sending mail problems and Solutions

    Time:2020-11-27

    . net background code using QQ mailbox server to send mail encountered problems:”mail from address must be same as authorization user”  First, take a look at my code implementation Background code: public class EmailHelper { /// <summary> ///Send mail /// </summary> ///< param name = “subject” > subject < / param > ///< param name […]

  • Talking about ASP.NET Core 2.0 Middleware

    Time:2020-11-26

    problem How to create the simplest ASP.NET Core middleware? answer Use VS to create a ASP.NET Empty project of core 2.0, please note Startup.cs Configure() method in: public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.Run(async (context) => { await context.Response.WriteAsync(“Hello World! (Run)”); }); } A better way to create a request pipeline is to use […]

  • Talking about ASP.NET Core 2.0 middleware with initial parameters

    Time:2020-11-25

    problem How to ASP.NET Core 2.0 passes initial parameters to middleware? answer In an empty project, create a poco (plain old CLR object) to save the required parameters of middleware: public class GreetingOptions { public string GreetAt { get; set; } public string GreetTo { get; set; } } Add a middleware: public class GreetingMiddleware […]

  • Implementation of WPF image button

    Time:2020-11-24

    This example for you to share the WPF image button implementation code, for your reference, the specific content is as follows Direct code public class ImageButton : System.Windows.Controls.Button { /// <summary> ///Pictures /// </summary> public static readonly DependencyProperty ImageProperty = DependencyProperty.Register(“Image”, typeof(ImageSource), typeof(ImageButton), new PropertyMetadata(null)); /// <summary> ///Pictures的宽度 /// </summary> public static readonly DependencyProperty ImageWidthProperty […]

  • Detailed explanation ASP.NET Framework level dependency injection in core

    Time:2020-11-23

    1、 ASP.NET Dependency injection in core This example shows how framework level dependency injection works in ASP.NET Working in the core. It is simple but powerful enough to do most of the work of dependency injection. Framework level dependency injection supports the following scopes: Singleton – always returns the same instance Transient – returns a […]

  • Asp.net MVC authentication user login forms implementation details

    Time:2020-11-22

    Here we use asp.net MVC‘s own authorizeattribute filter verifies the user’s identity, or you can use a custom filter. The steps are the same. Step 1:establish asp.net MVC project, in the project app_ There is one under the start folder FilterConfig.cs Global filters can be registered in this file. We add the authorizeattribute filter to […]

  • Asp.net Implementation of MVC scheduler

    Time:2020-11-21

    Asp.net Implementation of MVC scheduler This example uses fullcalendar JS: https://fullcalendar.io/ 1. view : @{ ViewBag.Title = “Index”; Layout = “~/Views/Shared/_Layout.cshtml”; } @section PageContent{ <style> .modal-backdrop { z-index: 9; } </style> <div> <div id=’calendar’> </div> </div> <!–Select Staff–> <div> <!– Trigger the modal with a button –> <button type=”button” data-toggle=”modal” data-target=”#myModal” style=”display: none”></button> <!– Modal […]

  • [translation] ASP.NET How to redirect the core 2.0 web address

    Time:2020-11-20

    problem How to ASP.NET URL redirection in core 2.0? answer Create an empty project in Startup.cs In the rewriter options, add the middleware URL: public void Configure(IApplicationBuilder app, IHostingEnvironment env) { var rewrite = new RewriteOptions() .AddRedirect(“films”, “movies”) .AddRewrite(“actors”, “stars”, true); app.UseRewriter(rewrite); app.Run(async (context) => { var path = context.Request.Path; var query = context.Request.QueryString; await […]