![]() |
|
[.NET] How to create new constructor? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] How to create new constructor? (/showthread.php?tid=5415791) |
How to create new constructor? - SirNoobHack - Sep 25, 2016 Code My.Computer.FileSystem.CreateDirectory("adasd")How can I shorten the class length if you understand what I mean. Dim CreateD() = My.Computer.FileSystem.CreateDirectory(Of String) was the best I could think of but it was incorrect. I don't even know what it's called that I'm trying to do :/ So to create a new directory I would only have to type: CreateD(folderName) Any sort of help would be GREATLY appreciated! 😉 * - assault0017 - Sep 25, 2016 Code for each dir as string in {"ads", "afd", "asopfdj", etc...}? * - My Computer - Sep 25, 2016 Do you mean something like this OP? Code Public Sub CreateDirectory(ByVal directory As String)Then you would just call it like this: Code CreateDirectory("C:\Users\Owner\Desktop\Test\")* - SirNoobHack - Sep 25, 2016 (Sep 25, 2016 11:45 AM)My Computer Wrote: Do you mean something like this OP? I thought about it but it wasn't really what I wanted, I must've thought that you could do what I've imagined in some way. Creating a method to make it is the best solution though, cheers mate! * - idb. - Sep 25, 2016 Code Public Sub CreateDirectory(ParamArray path As String())ParamArrays are your friend. Code CreateDirectory("C:\Foo1") |