I love my job! Today a package arrived with a few designs and I test "had".
My diet is hell, but what must have!
I love my job! Today a package arrived with a few designs and I test "had".
My diet is hell, but what must have!
One thing I have in the Express Editions of Visual Studio never understood: Why can not create interfaces ? The interface is a basic technique. Net framework. Even more incomprehensible is it, as not to dispense Interfaces must be if the (re) route is known. For can bypass Visual Basic Express Editions with interfaces, just add not.
If desired, an interface, just select the Add New Item and text file. The suffix of the filename is to . vb instead . Txt changed. There is created an empty text file in which, however, now an interface can be written:
Public Interface yuk Code Sample 1
End Interface
This interface can be edited as usual:
'Interface IGitt.vb Interface Code Example 2
is' implemented by classes that should have the disgusting properties
Public Interface yuk
ReadOnly Property Count () As Integer
Property City () As String
Function omg () As Boolean End
There should be no reason in spite Express Edition to waive Interfaces .
How can you see from my source code, something that was written at the beginning of the week? On the length of the identifier. Example:
Private Function getListOfDefaultKeywords () As String
On Friday, I would have written only GetKeyword.
you know the problem? A program to write a file in a directory move or copy, but you are not sure that the folder exists?
For such cases I had in the past, a routine that creates using a recursion nonexistent folder, after all, is already the parent Folders are missing.
The old solution worked well, not only liked me. A recursive function for such a simple purpose? Until I remembered out of the blue a better solution. The idea: split ()
Public Shared Sub folder check (ByVal folder path As String) Dim Code-Beispiel 1
asOrdner () As String
; sPfad As String Dim = ""
asOrdner = Split (Folder path "\\" )
For Each sOrdner As String In asOrdner
sPfad &= sOrdner & "\"
If Not Directory.Exists(sPfad) Then Directory.CreateDirectory(sPfad)
Next
End Sub
Das Ding funktionierte auf Anhieb gut (was immer verdächtig ist); allerdings kann CreateDirectory einen Ausnahmefehler . Generate Therefore, it is better to consider this.
Public Shared Function OrdnerChecked (ByVal folder path As String) As Boolean Code Example 2
Dim asOrdner () As String
Dim sPfad As String = ""
Dim bReturn Boolean = True
asOrdner = Split (Folder path "\\" )
Try
For Each sOrdner As String In asOrdner
sPfad &= sOrdner & "\"
If Not Directory.Exists(sPfad) Then _
Directory.CreateDirectory(sPfad)
Next
Catch ex As Exception
bReturn = False
End Try Return
bReturn
End Function
Now, with an If-Then-Else structure examined the existence of a folder, create the appropriate folder and file are stored. If the plant can not possibly be in the program itself responds to the problem (dialogue, etc.)