-
大小: 596KB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-06-01
- 語言: 其他
- 標(biāo)簽: Silverlight??顯示圖片??
資源簡介
Silverlight客戶端獲取服務(wù)器文件路徑或文件流,并通過路徑直接顯示服務(wù)器端圖片

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Net;
using?System.Windows;
using?System.Windows.Controls;
using?System.Windows.Documents;
using?System.Windows.Input;
using?System.Windows.Media;
using?System.Windows.Media.Animation;
using?System.Windows.Shapes;
namespace?ShowImgDemo
{
????public?partial?class?App?:?Application
????{
????????public?App()
????????{
????????????this.Startup?+=?this.Application_Startup;
????????????this.Exit?+=?this.Application_Exit;
????????????this.UnhandledException?+=?this.Application_UnhandledException;
????????????InitializeComponent();
????????}
????????private?void?Application_Startup(object?sender?StartupEventArgs?e)
????????{
????????????this.RootVisual?=?new?MainPage();
????????}
????????private?void?Application_Exit(object?sender?EventArgs?e)
????????{
????????}
????????private?void?Application_UnhandledException(object?sender?ApplicationUnhandledExceptionEventArgs?e)
????????{
????????????//?如果應(yīng)用程序是在調(diào)試器外運(yùn)行的,則使用瀏覽器的
????????????//?異常機(jī)制報(bào)告該異常。在?IE?上,將在狀態(tài)欄中用一個(gè)?
????????????//?黃色警報(bào)圖標(biāo)來顯示該異常,而?Firefox?則會(huì)顯示一個(gè)腳本錯(cuò)誤。
????????????if?(!System.Diagnostics.Debugger.IsAttached)
????????????{
????????????????//?注意:?這使應(yīng)用程序可以在已引發(fā)異常但尚未處理該異常的情況下
????????????????//?繼續(xù)運(yùn)行。?
????????????????//?對于生產(chǎn)應(yīng)用程序,此錯(cuò)誤處理應(yīng)替換為向網(wǎng)站報(bào)告錯(cuò)誤
????????????????//?并停止應(yīng)用程序。
????????????????e.Handled?=?true;
????????????????Deployment.Current.Dispatcher.BeginInvoke(delegate?{?ReportErrorToDOM(e);?});
????????????}
????????}
????????private?void?ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs?e)
????????{
????????????try
????????????{
????????????????string?errorMsg?=?e.Exceptionobject.Message?+?e.Exceptionobject.StackTrace;
????????????????errorMsg?=?errorMsg.Replace(‘“‘?‘\‘‘).Replace(“\r\n“?@“\n“);
????????????????System.Windows.Browser.HtmlPage.Window.Eval(“throw?new?Error(\“Unhandled?Error?in?Silverlight?Application?“?+?errorMsg?+?“\“);“);
????????????}
????????????catch?(Exception)
????????????{
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????294??2012-08-10?15:13??ShowImgDemo\ShowImgDemo\App.xaml
?????文件???????2351??2012-08-10?15:13??ShowImgDemo\ShowImgDemo\App.xaml.cs
?????文件????????353??2012-08-10?15:29??ShowImgDemo\ShowImgDemo\Bin\Debug\AppManifest.xaml
?????文件??????12800??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\Bin\Debug\ShowImgDemo.dll
?????文件??????22016??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\Bin\Debug\ShowImgDemo.pdb
?????文件???????7842??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\Bin\Debug\ShowImgDemo.xap
?????文件???????2843??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\Bin\Debug\ShowImgDemoTestPage.html
?????文件???????3935??2012-08-16?14:32??ShowImgDemo\ShowImgDemo\img\click.JPG
?????文件????????854??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\MainPage.xaml
?????文件???????1771??2012-08-16?14:22??ShowImgDemo\ShowImgDemo\MainPage.xaml.cs
?????文件???????1783??2012-08-10?15:13??ShowImgDemo\ShowImgDemo\obj\Debug\App.g.cs
?????文件???????1783??2012-08-10?15:13??ShowImgDemo\ShowImgDemo\obj\Debug\App.g.i.cs
?????文件???????7228??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????5507??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????2293??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\MainPage.g.cs
?????文件???????2293??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\MainPage.g.i.cs
?????文件????????881??2012-08-10?15:29??ShowImgDemo\ShowImgDemo\obj\Debug\ShowImgDemo.csproj.FileListAbsolute.txt
?????文件??????12800??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\ShowImgDemo.dll
?????文件???????5385??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\ShowImgDemo.g.resources
?????文件??????22016??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\ShowImgDemo.pdb
?????文件????????513??2012-08-16?14:34??ShowImgDemo\ShowImgDemo\obj\Debug\XapCacheFile.xm
?????文件????????207??2012-08-10?15:13??ShowImgDemo\ShowImgDemo\Properties\AppManifest.xm
?????文件???????1318??2012-08-10?15:13??ShowImgDemo\ShowImgDemo\Properties\AssemblyInfo.cs
?????文件???????4864??2012-08-16?14:32??ShowImgDemo\ShowImgDemo\ShowImgDemo.csproj
?????文件???????1226??2012-08-16?14:32??ShowImgDemo\ShowImgDemo\ShowImgDemo.csproj.user
?????文件???????1422??2012-08-10?15:13??ShowImgDemo\ShowImgDemo.sln
????..A..H.?????29184??2012-08-16?14:34??ShowImgDemo\ShowImgDemo.suo
?????文件???????4096??2012-08-16?14:21??ShowImgDemo\ShowImgDemo.Web\bin\ShowImgDemo.Web.dll
?????文件???????7680??2012-08-16?14:21??ShowImgDemo\ShowImgDemo.Web\bin\ShowImgDemo.Web.pdb
????.......??????7842??2012-08-16?14:34??ShowImgDemo\ShowImgDemo.Web\ClientBin\ShowImgDemo.xap
............此處省略36個(gè)文件信息
評論
共有 條評論