Cov txheej txheem:

Peb puas tuaj yeem muaj ntau yam app config cov ntaub ntawv?
Peb puas tuaj yeem muaj ntau yam app config cov ntaub ntawv?

Video: Peb puas tuaj yeem muaj ntau yam app config cov ntaub ntawv?

Video: Peb puas tuaj yeem muaj ntau yam app config cov ntaub ntawv?
Video: Zoo Siab Nrog Koj - Paj Tsua Thoj [ Official MV ] Nkauj Tawm Tshiab 2022 2024, Hlis ntuj nqeg
Anonim

Koj ua tsis tau siv ntau yam kev teeb tsa cov ntaub ntawv (piv txwv li ib lub tsev qiv ntawv project) tsis muaj coding. Kev xaiv: Koj siv tau Cov ConfigurationManager Class kom thauj khoom lwm qhov config ntaub ntawv los ntawm code.

Raws li txoj cai, lub tsev qiv ntawv hauv chav kawm puas tuaj yeem muaj cov ntaub ntawv app config?

Tsis yog, chav tsev qiv ntawv tuaj yeem tuav teeb tsa cov ntaub ntawv , tab sis lawv cov nqi yuav tau txhais nyob rau hauv lub daim ntawv thov configuration (web. config , app . config ). Qhov ntawd yog vim kev teeb tsa overriding feature.

Tsis tas li ntawd, app config file yog dab tsi? Cov app . config cov ntaub ntawv yog XML ntaub ntawv nws lub hom phiaj nws yog kom muaj tej yam txawv txav kev teeb tsa ntawm koj daim ntawv thov.

Kuj nug, kuv cov ntaub ntawv app config nyob qhov twg?

config ntaub ntawv . Cov app . config cov ntaub ntawv yuav tsum nyob hauv App_ClientConfig folder hauv koj lub installation. Hauv Windows, txoj kev yuav yog C: Program Cov ntaub ntawv (x86)ScreenConnectApp_ClientConfig.

Muaj pes tsawg app config file hauv ASP NET daim ntawv thov?

Daim ntawv thov Configuration Files

  • executable-hosted app. Cov apps no muaj ob daim ntawv teeb tsa: cov ntaub ntawv teeb tsa qhov chaw, uas tau hloov kho los ntawm tus tsim tawm thaum tsim kho, thiab cov ntaub ntawv tso tawm uas tau muab faib nrog lub app.
  • ASP. NET-hosted app.
  • Internet Explorer-hosted app.

Pom zoo: