| Forums.Sureshkumar.net : A Perfect Place to Share Knowledge Blogs Games Magazines |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jan 2007
Posts: 16
Thanks: 2 Thanked 0 Times in 0 Posts Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 2
|
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 Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
Re: Path combining problem in c#
Incorrect Results With Path.Combine - Hilton Giesenow's Jumbled Mind
basically remove the "\" from the 2nd path Xander |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tips for interview | ozobalu | HR Questions | 9 | 23-09-08 12:32 AM |
| must read all UG students!!!!!!!!!!!!! | sanjay | Other Queries | 15 | 04-09-08 04:10 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 12:30 PM |
| System Problem | au123 | NETWORK ADMINISTRATION , HARDWARE & TROUBLESHOOTING | 4 | 09-10-06 10:59 PM |