In this video we will see a major Path.Combine method overload. This method in fact allowed to use only two parameters that represent the two paths could be combined so as to make the Path.Combine C: \ program files with the path "Microsoft Visual Studio 10." Let's see. Of course, it generates an error if we do not put the double slash or hyphen snail Here this result is the traditional Path.combine that was present in Visual Studio 2008. We now have the possibility to use three new overloads that allow you to increase the number of parameters used.
For example we can add to this route is another folder for which we are at the bottom and add the third parameter. Let's go back to run this code and here we have the combination of the three subdirectories. We can also use the following overload that allows you to use an array instead of four parameters that we can add another directory, so we go inside this folder. Come on down, we add the last folder, launch the code and see what was added in the bottom of the path that was generated by the Path.Combine method.
Even more interesting and last Path.Combine overload of this method that allows us to use a single parameter that represents an array of strings. For example, instead of using a syntax like this with four parameters we can put these parameters into an array and then call the Path.Combine method on the array we just created.
Let's do an experiment now and then we create an array of strings, we call this "path" will be the new array of strings made up of "C: \ Program files" and then on "Microsoft Visual Studio 10.0." Then they are going ahead with Common7 add rows and to show that this overload is even more useful and more convenient than any other because it allows us to extend the number of parameters and therefore the number of directories that may be used in combination. Go ahead and add also the 1033 folder in the bottom of the list of folders to which we are going to comment on this line and replace it with Console.WriteLine that the method is always Path.combine but instead to explain the route we want to combine array that we created above, run this code again and actually see the results we hope that ultimately the new method overload Path.combine instead can extend beyond the two parameters that had a before and concatenation of the directory and ' Last overload allows you to use an array of strings, and allows us to go to infinity in the combination of the directory we want.