45,000 Jobs - Get an Interview Call,  Post Your Resume Here
SURESHKUMAR.NET FORUMS
Registered Member Login:
Not a member? Register today!



Welcome to the SURESHKUMAR.NET FORUMS.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.




Path combining problem in c#

        

Reply
 
LinkBack Thread Tools Display Modes
Old 15-04-07, 05:58 AM   #1 (permalink)
Junior Member
 
Join Date: Jan 2007
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 3 arumahi is on a distinguished road
Path combining problem in c#

Hi All,
I am doing a task regarding Plug-In Installer, in my code I was trying to combine two part of the paths like the following codewhen I was debugging its saying that the part of the path could not find. I dont know whats the wrong but the path was correct. Could any one please tell me and any comments please welcome.

I defined a property which combines the paths. and Somewhere in the code I am using those properties , at that place while debugging error is coming with the message as said above.Here is my code:

// Propertiy combining the paths and errors also coming here (after @)
privatestring SharePointBinPath
{
get
{
string _commonProgramFiles = System.Environment.GetEnvironmentVariable("CommonProgramFiles");
return (Path.Combine(_commonProgramFiles, @"\Microsoft Shared\web server extensions\12\BIN\"));
}
}


// I am using the peroperties in this method
publicbool connectToRemote()
{
bool _success = true;
#region for moving the files to proper folders and running the .bat file

//HERE

File.Copy(Path.Combine(this.TempFolder2,this.installFile),this.SharePointBinPath,true);
File.Delete(Path.Combine(this.TempFolder2, this.installFile));
this.ExecutionMessages = "1. Moving LGinstall.bat file sucessful";
File.Copy(Path.Combine(this.TempFolder2, this.CabFile), this.SharePointBinPath, true);
File.Delete(Path.Combine(this.TempFolder2, this.CabFile));
this.ExecutionMessages = "2. Moving .CAB done successfully";
string path = Path.Combine(this.SharePointBinPath, this.installFile);


Waiting for anybodys reply

Best Regards,
Aruna

arumahi is offline Offline   Reply With Quote
Old 21-08-08, 09:09 PM   #2 (permalink)
Junior Member
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 Xander.Hurley is on a distinguished road
Re: Path combining problem in c#

Incorrect Results With Path.Combine - Hilton Giesenow's Jumbled Mind

basically remove the "\" from the 2nd path

Xander
Xander.Hurley is offline Offline   Reply With Quote
Reply

Tags
combining , path , problem


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tips for interview ozobalu HR Questions 13 14-11-09 01:50 AM
must read all UG students!!!!!!!!!!!!! sanjay Other Queries 16 07-02-09 02:31 PM
creativity in problem solving pramodkumar.kak Group Discussion Topics 1 25-01-07 11:23 PM
Simple solution to a complex problem AjayKumar.Kataram Inspire yourself & Others - Leaders Zone 3 10-10-06 11:30 AM
System Problem au123 NETWORK ADMINISTRATION , HARDWARE & TROUBLESHOOTING 4 09-10-06 09:59 PM


All times are GMT +6.5. The time now is 02:43 PM.

More Interview Questions Here...

Content Relevant URLs by vBSEO 3.3.0