how to set file including in windows application

Posted by Venkatesh under C# on 5/9/2011 | Points: 10 | Views : 1377 | Status : [Member] | Replies : 3
Hi,

i am copying one text file location to another location.When i copied its working.After that, copied file will be in exclude mode.i want that file include in that application
How to do that?

Thanks
Venkatesh.P




Responses

Posted by: Vuyiswamb on: 5/9/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Good Day ,

Your statement contradict each other.

You wrote:

i am copying one text file location to another location.When i copied its working.After that, copied file will be in exclude mode.

The above statement make sense, but you continue to say

i want that file include in that application


Now i dont understand what you want here, because to me its like you say you want it to be included again or mybe i did not understand you.

Please try to explain clearly, your english is not bad, you can do better than this.

Looking forward for your reply.

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Venkatesh on: 5/10/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

I am doing windows application.In which i am doing file copy like

he select one file some other location like C:\\Desktop\\test.txt this file he saved in other location like Project Solution folder

at that time i am doing file copy method which is having 2 properties source and destination location.

When user press the save button that test.txt file copied into the solution folder. After that when i refresh button in solution explorer view

It will displayed that test.txt file in exclude mode. I want that into inlude in that project How to do that?

Thanks
Venkatesh.P

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 5/10/2011 [Member] Starter | Points: 25

Up
0
Down
Hey
Just open the project file as xml then incude the content and save it.

XElement xe = XElement.Load(@"D:\\Path\MyControls.csproj");
xe.Add(new XElement("ItemGroup",new XElement("Content",new XAttribute("Include","<FileNametoinclue>"))));
xe.Save(@"D:\\Path\MyControls.csproj");

Thanks,
Debata


Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response