resources

Exception with String argument, why is this happening?

丶灬走出姿态 提交于 2019-12-25 03:27:06
问题 I have : Dim con As New OleDbConnection(My.Resources.ConnectionString) // Give exception = Format of the initialization string does not conform to specification starting at index 62. When I substitute the actual value of the Resource, it give no exception : Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\rawData.xlsx;Extended Properties=""Excel 12.0 XML;""") The value of ConnectionString in Resources : <data name="ConnectionString" xml:space="preserve"> <value

Where to store common application settings

别说谁变了你拦得住时间么 提交于 2019-12-25 02:44:58
问题 I want to move my application settings out of XAML and into a config file. For example, ToolTips and Content strings for Buttons/CheckBoxes and Labels. Is this the job of a ResourceDictionary, or should I use the App.Config or Settings.settings file? The ToolTips and Content strings are not really per user, they are more Application wide and may change if the UI is internationalized. EDIT: I hear use a Resource Dictionary or use a App.Config , what is the difference? Thanks! 回答1: Tool tips

Accessing the resources in the published application

怎甘沉沦 提交于 2019-12-25 01:52:50
问题 I followed a tutorial on Video Player. It is nice but I am imagining a different situation. I need to embed some videos in the Resources file and dynamically change the videos depending on the user input. I have managed this running inside Visual Studio 2010. using the switch statements. But I have to specify the path of that video in the resources file. for eg : case 1 : video = new Video("..//..//Resources//The video name"); But when I publish this application using the click once wizard,

Wpf Font Style Not Working in RunTime and don't show correct view of my font in Design Time

痴心易碎 提交于 2019-12-25 01:46:57
问题 I using a separate project for my styles a and i have some line of codes like this in it: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Style x:Key="NazaninFont" TargetType="Control"> <Setter Property="FontFamily" Value="pack://application:,,,/Extra/Fonts/#IRNazanin"/> </Style> ...... </ResourceDictionary> My another styles (like control effects and...) work well when i use my style key in the

delete specific resource i.e, vm,nic,nsg using terraform

a 夏天 提交于 2019-12-25 00:47:21
问题 I have created azure vm ,nic ,nsg inside the firewall. Now i need to delete specific created vm,nic,nsg inside the firewall. This i will be doing continuously. When i try i delete with specific vm,ns,nic with below, but it is deleting total resource group. terraform init terraform apply -no-color -auto-approve terraform destroy -force My code: # Configure the Microsoft Azure Provider provider "azurerm" { subscription_id = "xxxxx" client_id = "xxxxx" client_secret = "xxxxx" tenant_id = "xxxxx"

Parse XML File within Jar

[亡魂溺海] 提交于 2019-12-25 00:16:08
问题 I am having troubles loading an XML file within my java game. Here is where the file is located, (from Eclipse): I have been doing research, and apparently to use the xml file in a JAR file, I need to call DocumentBuilder.parse(InputStream) The problem is when I try to get the InputStream using getResourceAsStream("res/xml/items.xml") it always returns null. How could I make it not return null? I don't want to put my res folder inside of my "src" folder, but is there some setting in Eclipse

Best practice to update parent or other simultaneous Angular controllers?

十年热恋 提交于 2019-12-24 21:47:36
问题 Forgive if this is general, but I'm looking for an approach and I'm new to Angular. Say I have a main controller and a runtime created modal controller. Let them be WidgetCtrl and NewWidgetModalCtrl. I want to create a Widget and send that data to the server using $resource.save() . It returns some data and we close the "New Widget Modal" (it gets $destroyed). How would I add this widget to the list in WidgetCtrl? Some say to use a shared service/factory. But the problem is that these are

Images not loading in executable jar

家住魔仙堡 提交于 2019-12-24 21:33:02
问题 Note: I did try out ImageIcon background = new ImageIcon(getClass().getResource("MyImage.jpg")); mentioned in all the answers. My project works fine using netbeans IDE run. But once I export to an executable jar using 'Clean and build', A null pointer exception is thrown and the frame with the image will not even open. (The executabe jar is in the 'dist' folder) Even after using relative path, the image will never load. I put the image in same directory as the executable jar.(dist) I put the

Get file names from Resources sub folder

拥有回忆 提交于 2019-12-24 20:52:39
问题 In my Resources folder I have a subfolder for images, I would like to get all the file names of those images from within that folder. tried several Resources.loadAll methods to afterwards get the .name but without success was is the right practice to achieve what I'm trying to do here ? 回答1: Hmm... why not try this. using System.IO; Const String path = ""; /file path private void GetFiles() { string [] files = Directory.GetFiles (path, "*.*"); foreach (string sourceFile in files) { string

Java Swing Problem

痞子三分冷 提交于 2019-12-24 20:12:48
问题 I have a board with cards in which I have to find matches. I have two variables buttonA and buttonB to keep track of the squares clicked. When they are equal I can remove them from the board by simply adding this code: cards[buttonA].setVisible(false); cards[buttonB].setVisible(false); How can I place the same image on all the buttons after finding matches? I tried the following but it instead of changing the image simply leaves the same image on the buttons cards[buttonA].setIcon(new