国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

.NET客戶端應(yīng)用程序:.NET應(yīng)用程序更新組件(4)

2024-07-10 13:04:07
字體:
供稿:網(wǎng)友

作者:jamie cool

microsoft corporation

3/4/02

翻譯:李嘉
北京.東方瑞道
2004-6-3

(接上篇)

method #2: manifest check – to solve the atomicity problem with direct file checks a level of indirection is needed. to create a level of indirection a manifest file on the server is used. a valid server manifest file for use with the .net application updater component looks like this:



<versionconfig>

<availableversion>1.0.0.0</availableversion>

<applicationurl>http://localhost/demos/selfupdate/v1/</applicationurl>

</versionconfig>



availableversion specifies the assembly version number of the latest available version. the applicationurl property specifies the url where that version of the application resides. when the administrator wants to update the client applications, they would copy the new version of the app up to the web server and modify the server manifest file appropriately. the client itself will then detect that the server manifest file has changed and download the manifest file. the client then compares the assembly version number specified in the manifest with the assembly version number of the application’s .exe file. if the server manifest file availableversion is newer, the application knows it’s time to perform an update. this approach has none of the atomicity problems of the previous approach and is the recommended way to check for updates for most applications.

方法二.顯式檢查----為解決直接文件檢查存在的原子問題,有必要進(jìn)行一定級別的間接檢查。為產(chǎn)生一間接級別,在服務(wù)器上使用一個顯式的文件。一個可和.net應(yīng)用程序更新組件使用的有效的服務(wù)器顯式文件大致是這個樣子:

<versionconfig>

<availableversion>1.0.0.0</availableversion> <applicationurl>http://localhost/demos/selfupdate/v1/</applicationurl>

</versionconfig>

availableversion指定最新的可用程序集的版本號。applicationurl屬性指定該版本應(yīng)用程序所在的url地址。當(dāng)管理員想要更新客戶端應(yīng)用程序時,他們就會將應(yīng)用程序的新版本拷貝到web服務(wù)器上并且適當(dāng)?shù)男薷姆?wù)器顯式文件。客戶端自身會探測到服務(wù)器顯式文件已被修改,然后下載顯式文件。客戶端隨后比較顯式文件中指定的程序集版本號與應(yīng)用程序exe文件的版本號。如果服務(wù)器顯式文件中的可用版本號較新,應(yīng)用程序就知道是時間實(shí)現(xiàn)更新了。這種方法沒有前一種方法的原子問題,對大多數(shù)應(yīng)用程序而言是推薦使用的方法。

method #3: xml web service check – xml web services provide a way to perform more advanced update checks. for example, suppose you wanted to roll out an update to a set of early adopters before you rolled it out to the rest of your users. if the client application calls an xml web service to check if an update is available, that xml web service could then look up that user in a database and determine if the user is an early adopter or not. if they are, the xml web service could return a value indicating that an update is available. if not, the web service could return a value indicating that a new update is not available. because the web service used to check for updates could take many forms depending on what custom functionality is desired, the .net application updater component does not provide direct xml web service support. to use an xml web service to check for updates, first build the xml web service and then hook the oncheckforupdate event. this allows the poller thread’s update check to be replaced with your own custom check. the oncheckforupdate event has a return value to indicate whether an update was detected or not.

方法三:xml web service 檢查----xml web services提供一種更高級的更新檢查的方式。比如,假定你希望在轉(zhuǎn)出更新你的其他用戶之前先對一系列早期用戶進(jìn)行更新,如果客戶端應(yīng)用程序調(diào)用一個xml web service來檢查一項更新是否可用,那個xml web service還可以在數(shù)據(jù)庫中查詢該用戶并判斷該用戶是否是早期用戶。如果他們是早期用戶,xml web service就返回一個值表示更新可用。如果不是,web service就返回一個值表示更新不可用。因為采用web service為更新做檢查能夠根據(jù)客戶端所希望的功能采取許多形式,.net 應(yīng)用程序更新組件并不提供直接xml web service支持。采用xml web service來進(jìn)行更新檢查,首先建立xml web service并掛鉤oncheckforupdate事件。這樣就允許你自己的自定義檢查代替輪詢者線程更新檢查。oncheckforupdate事件有一個返回值,該值表示更新是否被檢測到。



(未完待續(xù))
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 中卫市| 龙川县| 自治县| 邻水| 武宣县| 类乌齐县| 隆林| 丰城市| 邢台市| 永福县| 嘉义市| 农安县| 宣恩县| 九寨沟县| 比如县| 阜新| 尚义县| 岚皋县| 白银市| 剑阁县| 林口县| 雅安市| 香河县| 宁化县| 徐汇区| 天等县| 凤冈县| 辽中县| 万山特区| 福鼎市| 许昌市| 佛学| 灵台县| 呼图壁县| 门头沟区| 长海县| 松江区| 祁阳县| 阿城市| 新兴县| 酉阳|