![]() |
|
![]() |
| LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Junior Member Join Date: Jan 2007
Posts: 16
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 3 | 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 |
| | |
| | #2 (permalink) |
| Junior Member Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 | Re: Path combining problem in c# Incorrect Results With Path.Combine - Hilton Giesenow's Jumbled Mind basically remove the "\" from the 2nd path Xander |
| | |
![]() |
| Tags |
| combining , path , problem |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
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 |
| More Interview Questions Here... |