国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 六安市| 江阴市| 界首市| 敖汉旗| 庄浪县| 依安县| 永州市| 济阳县| 长垣县| 金山区| 嘉峪关市| 赫章县| 贵港市| 洮南市| 精河县| 洪湖市| 盈江县| 乡城县| 新河县| 临江市| 包头市| 沁阳市| 平凉市| 林周县| 十堰市| 红原县| 宝丰县| 建昌县| 兴安县| 满洲里市| 定边县| 哈尔滨市| 中卫市| 涞源县| 临漳县| 和硕县| 改则县| 龙海市| 蒙自县| 三河市| 石首市|