什么是应用程序的原始站点以及何时使用它 [英] What is application's site of origin and when to use it

查看:56
本文介绍了什么是应用程序的原始站点以及何时使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 什么是应用程序的原始站点
  • 何时使用
  • 与其关联的资源文件的构建操作如何
  • pack://application:,, 和 pack://siteoforigin:,,, 的区别是什么

推荐答案

原点是应用程序可执行程序集(即用户运行的 .exe)的位置(即物理文件夹).因此,URI 与该文件夹相关.

The site of origin is the location (i.e. the physical folder) of the application executable assembly (i.e. the .exe that the user runs). The URI is thus relative to that folder.

示例:您有

  • C:\Programs\MyApp\MyApp.exe
  • C:\Programs\MyApp\MyIcon.bmp
  • C:\Programs\MyApp\Icons\MyOtherIcon.bmp

包 URI 是 pack://siteoforigin:,,,/MyIcon.bmppack://siteoforigin:,,,/Icons/MyOtherIcon.bmp运行 MyApp.exe 时.这意味着您必须将这些文件复制到这些位置.

The pack URIs are pack://siteoforigin:,,,/MyIcon.bmp and pack://siteoforigin:,,,/Icons/MyOtherIcon.bmp when running the MyApp.exe. That means you have to copy those files to those places.

相比之下,应用程序包 URI 指的是嵌入在您的程序集中的资源(通过使用构建操作资源").

In contrast, the application pack URI refers to resources embedded in your assembly (by using Build Action "Resource").

这篇关于什么是应用程序的原始站点以及何时使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆