Configuration Manager nyob rau hauv asp net yog dab tsi?
Configuration Manager nyob rau hauv asp net yog dab tsi?

Video: Configuration Manager nyob rau hauv asp net yog dab tsi?

Video: Configuration Manager nyob rau hauv asp net yog dab tsi?
Video: New App One Connect All | WhoReact 2024, Kaum ib hlis
Anonim

Cov ConfigurationManager chav kawm ua rau lub Web lossis Windows daim ntawv thov nkag mus rau lub tshuab, daim ntawv thov, thiab cov neeg siv kev teeb tsa cov ntaub ntawv. Lub npe thiab qhov chaw ntawm lub kev teeb tsa cov ntaub ntawv nyob ntawm seb koj puas ua haujlwm nrog Web application lossis Windows console application.

Ntawm no, kev siv Configuration Manager yog dab tsi?

ConfigurationManager yog chav kawm uas pab nyeem cov ntaub ntawv los ntawm kev teeb tsa . Muab kev nkag mus rau kev teeb tsa cov ntaub ntawv rau cov neeg siv khoom. Rau siv tus ConfigurationManager chav kawm, koj qhov project yuav tsum siv qhov System. Kev teeb tsa kev sib dhos.

Tsis tas li ntawd, ConfigurationManager ConnectionStrings yog dab tsi? ConfigurationManager . ConnectionStrings hais txog ntu tshwj xeeb ntawm koj lub app config qhov twg khaws cov ntaub ntawv nkag mus rau koj cov ntaub ntawv (ib lossis ntau dua). Tshooj muaj cov kab zoo li no < kev sib txuasStrings > <add name="MyDataBase" connectionString ="Provider=Microsoft.

Kuj kom paub yog, ConfigurationManager AppSettings ua haujlwm li cas?

Nws tau txais cached, ntawm thawj nkag ntawm ib qho khoom, yog li nws ua tsis tau nyeem los ntawm cov ntaub ntawv lub cev txhua zaus koj nug txog tus nqi. Qhov no yog vim li cas nws thiaj li yuav tsum tau rov pib dua Windows app (lossis Refresh lub config) kom tau txais tus nqi tshiab, thiab vim li cas ASP. Net app yuav rov pib dua thaum koj hloov kho lub vev xaib.

Yuav ua li cas kuv ntxiv ib qhov system configuration reference?

# Hauv Solution Explorer, right-click lub project node thiab nias Ntxiv Reference . # Hauv Ntxiv Reference dialog box, xaiv lub. NET tab thiab xaiv Qhov system . Kev teeb tsa los ntawm cov npe thiab ces nias OK.

Pom zoo: