Wpf file embeded resource will compile the file into the assembly and it will be readonly and can not be writable.

using System.IO;
using System.Reflection; void ReadEmbededResourceDemo()
{
var assembly = Assembly.GetExecutingAssembly();
var names = assembly.GetManifestResourceNames();
var resourceName = "WpfApplication7.Resource.JsonData.json"; using (Stream stream = assembly.GetManifestResourceStream(resourceName))
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
MessageBox.Show(result);
}
}

While you set the file as Copy always it will copy the file and its folder to *.exe location.

 void WriteResourceAlwaysCopy()
{
string dir = Directory.GetCurrentDirectory();
var allFiles=Directory.GetFiles(dir, "*", SearchOption.AllDirectories);
var jsonFile = @".\Resource\JsonData.json";
string jsonContent=File.ReadAllText(jsonFile);
File.AppendAllText(jsonFile, jsonContent, Encoding.UTF8);
}

wpf file embeded resource is readonly,Copy always will copy the file and its folder to the bin folder的更多相关文章

  1. OGG报错:Cannot load ICU resource bundle 'ggMessage', error code 2 - No such file or directory

    [oracle@dgdb1 ~]$ ggsci Oracle GoldenGate Command Interpreter for OracleVersion 11.2.1.0.3 14400833 ...

  2. python deep copy and shallow copy

    Python中对于对象的赋值都是引用,而不是拷贝对象(Assignment statements in Python do not copy objects, they create bindings ...

  3. python中的shallow copy 与 deep copy

    今天在写代码的时候遇到一个奇葩的问题,问题描述如下: 代码中声明了一个list,将list作为参数传入了function1()中,在function1()中对list进行了del()即删除了一个元素. ...

  4. Shallow copy and Deep copy

    Shallow copy and Deep copy 第一部分: 一.来自wikipidia的解释: Shallow copy One method of copying an object is t ...

  5. AJ整理问题之:copy,对象自定义copy 什么是property

    AJ分享,必须精品 copy copy的正目的 copy 目的:建立一个副本,彼此修改,各不干扰 Copy(不可变)和MutableCopy(可变)针对Foundation框架的数据类型. 对于自定义 ...

  6. [CareerCup] 13.4 Depp Copy and Shallow Copy 深拷贝和浅拷贝

    13.4 What is the difference between deep copy and shallow copy? Explain how you would use each. 这道题问 ...

  7. (五)聊一聊深Copy与浅Copy

    一.关于浅copy与深copy 首先说明一下: 在python中,赋值其实就是对象的引用,变量就是对象的一个标签,如果把内存对象比喻成一个个房间,那么变量就是门牌号. 深copy与浅copy只是针对可 ...

  8. Cannot find ./catalina.sh The file is absent or does not have execute permission This file is nee

    从tomcat官网上下载了apache-tomcat-5.5.36.zip,在window xp系统里面解压以后,直接放在了linux服务器上. 进入tomcat/bin目录,执行启动的时候出现如下错 ...

  9. Python的深copy和浅copy

    浅拷贝(copy):拷贝父对象,不会拷贝对象的内部的子对象. 深拷贝(deepcopy): copy 模块的 deepcopy 方法,完全拷贝了父对象及其子对象. 浅copy: a = [1, 2, ...

随机推荐

  1. SQL Server 索引分析开关

    set statistics io onset statistics profile on

  2. 【RTOS】基于V7开发板的uCOS-III,uCOS-II,RTX4,RTX5,FreeRTOS原版和带CMSIS-RTOS V2封装层版全部集齐

    RTOS模板制作好后,后面堆各种中间件就方便了. 1.基于V7开发板的最新版uCOS-II V2.92.16程序模板,含MDK和IAR,支持uC/Probe https://www.cnblogs.c ...

  3. jQuery 源码解析(二十七) 样式操作模块 坐标详解

    样式操作模块可用于管理DOM元素的样式.坐标和尺寸,本节讲解一下坐标这一块. 对于坐标来说,jQuery提供了一个offset方法用于获取第一个匹配元素的坐标或者设置所有匹配元素的坐标,还有offse ...

  4. FCC---Use the CSS Transform scale Property to Change the Size of an Element

    To change the scale of an element, CSS has the transform property, along with its scale() function. ...

  5. 数字图像处理:图像的灰度变换(Matlab实现)

    (1)线性变换:通过建立灰度映射来调整源图像的灰度. k>1增强图像的对比度:k=1调节图像亮度,通过改变d值达到调节亮度目的:0 i = imread('theatre.jpg');i = i ...

  6. JS 输出

    JS 输出 JavaScript 通常用于操作 HTML 元素. 操作 HTML 元素 如需从 JavaScript 访问某个 HTML 元素,您可以使用 document.getElementByI ...

  7. 使用Jitpack发布自己的Android Library

    版权声明:本文为xing_star原创文章,转载请注明出处! 本文同步自http://javaexception.com/archives/169 使用Jitpack发布自己的Android Libr ...

  8. jmeter控制器(四)

    交替控制器: 交替控制器主要是让控制器里面的请求顺序执行,如下图设置了审批管理循环3次,那么第一次运行就执行了请假模块,第二次运行执行了请假模块1,第二次执行了请加模块2,依顺序每一个请加模块只执行一 ...

  9. [Go] Golang中的面向对象

    struct interface 就可以实现面向对象中的继承,封装,多态 继承的演示:Tsh类型继承People类型,并且使用People类型的方法 多态的演示Tsh类型实现了接口Student,实现 ...

  10. 对于Python语音性能的一些个人见解

    虽然运行速度慢是 Python 与生俱来的特点,大多数时候我们用 Python 就意味着放弃对性能的追求.但是,就算是用纯 Python 完成同一个任务,老手写出来的代码可能会比菜鸟写的代码块几倍,甚 ...