• 大小: 81KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: 其他
  • 标签:

资源简介

使用silverlight生成条码二维码的开发代码。很具有参考意义。

资源截图

代码片段和文件信息

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 SilverlightBarcodeApplication
{
    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 Page();
        }

        private void Application_Exit(object sender EventArgs e)
        {

        }
        private void Application_UnhandledException(object sender ApplicationUnhandledExceptionEventArgs e)
        {
            // If the app is running outside of the debugger then report the exception using
            // the browser‘s exception mechanism. On IE this will display it a yellow alert 
            // icon in the status bar and Firefox will display a script error.
            if (!System.Diagnostics.Debugger.IsAttached)
            {

                // NOTE: This will allow the application to continue running after an exception has been thrown
                // but not handled. 
                // For production applications this error handling should be replaced with something that will 
                // report the error to the website and stop the application.
                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 2 Application “ + errorMsg + “\“);“);
            }
            catch (Exception)
            {
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2009-05-18 11:28  SilverlightBarcode\
     文件        1536  2009-04-24 12:41  SilverlightBarcode\SilverlightBarcode.sln
     文件       38400  2009-05-18 11:31  SilverlightBarcode\SilverlightBarcode.suo
     目录           0  2009-05-18 11:25  SilverlightBarcode\SilverlightBarcodeApplication\
     文件         312  2009-04-24 12:36  SilverlightBarcode\SilverlightBarcodeApplication\App.xaml
     文件        2413  2009-04-24 12:36  SilverlightBarcode\SilverlightBarcodeApplication\App.xaml.cs
     目录           0  2009-05-18 11:25  SilverlightBarcode\SilverlightBarcodeApplication\Bin\
     目录           0  2009-05-18 11:25  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\
     文件         531  2009-04-24 15:18  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\AppManifest.xaml
     文件       10240  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\SilverlightBarcodeApplication.dll
     文件       26112  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\SilverlightBarcodeApplication.pdb
     文件       10414  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\SilverlightBarcodeApplication.xap
     文件        8704  2009-04-24 15:18  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\SilverlightBarcodeClassLibrary.dll
     文件       22016  2009-04-24 15:18  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\SilverlightBarcodeClassLibrary.pdb
     文件        2930  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\Bin\Debug\TestPage.html
     目录           0  2009-05-18 11:25  SilverlightBarcode\SilverlightBarcodeApplication\obj\
     目录           0  2009-05-18 11:25  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\
     文件        1885  2009-04-24 15:18  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\App.g.cs
     文件        2391  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\Page.g.cs
     目录           0  2009-04-24 15:17  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\Refactor\
     文件        7200  2009-04-24 15:18  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\ResolveAssemblyReference.cache
     文件        2130  2009-05-18 11:31  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\SilverlightBarcodeApplication.csproj.FileListAbsolute.txt
     文件       10240  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\SilverlightBarcodeApplication.dll
     文件        1726  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\SilverlightBarcodeApplication.g.resources
     文件       26112  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\SilverlightBarcodeApplication.pdb
     目录           0  2009-04-24 12:36  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\TempPE\
     文件         988  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\obj\Debug\XapCacheFile.xml
     文件        1164  2009-05-18 09:16  SilverlightBarcode\SilverlightBarcodeApplication\Page.xaml
     文件        3070  2009-05-18 09:15  SilverlightBarcode\SilverlightBarcodeApplication\Page.xaml.cs
     目录           0  2009-05-18 11:25  SilverlightBarcode\SilverlightBarcodeApplication\Properties\
     文件         207  2009-04-24 12:36  SilverlightBarcode\SilverlightBarcodeApplication\Properties\AppManifest.xml
............此处省略22个文件信息

评论

共有 条评论

相关资源