[Release] Console Commander

Posts 16–17 of 17 · Page 2 of 2
Quote Originally Posted by user590177 View Post
thanks dudes, I can make this even more good
Here's a bit of my Exec Command:
Code:
Namespace Executing

    Public Class ExecTool

        ''' <summary>
        ''' Executes a command from a remote file
        ''' </summary>
        ''' <param name="stringDirName"></param>
        ''' <remarks></remarks>
        Public Sub Exec(ByVal stringDirName As String)
            Using reader As New System.IO.StreamReader(stringDirName & ".ccmd")
                Console.WriteLine(vbCrLf & "Executing:> " & stringDirName & ".....DONE! (3Li0 ROCKS!)" & vbCrLf)
                Dim commandList As String = reader.ReadToEnd()
                Dim totalLines As String() = commandList.Split(vbCrLf)
                For Each line As String In totalLines
                    If line.Contains("//") Then
                        Dim i As Integer = line.IndexOf("//")
                        line.Remove(i, line.Length - i)
                    Else
                        If line.Contains("Dis") Then
                            Dim msg As String = line.Replace("Dis ", "")
                            Dis(msg)
                        End If
                        If line.Contains("Dir") Then
                            Dim path As String = line.Replace("Dir ", "")
                            If path = "xPath" Then
                                path = CurDir()
                                Dir(path)
                            Else
                                Dir(path)
                            End If
                            If line.Contains("Color") Then
                                Dim id As String = line.Replace("Color ", "")
                                MsgBox(id)
                                If id = "F1" Then Console.ForegroundColor = ConsoleColor.Blue
                                If id = "F2" Then Console.ForegroundColor = ConsoleColor.Red
                                If id = "F3" Then Console.ForegroundColor = ConsoleColor.White
                                If id = "FG" Then Console.ForegroundColor = ConsoleColor.Yellow
                            End If
                            If line.Contains("Title") Then
                                Dim newTitle As String = line.Replace("Title ", "")
                                Title(newTitle)
                            End If
                            If line.Contains("W") Then
                                Dim a As String = line.Replace("W ", "").Replace(" || ", "").Replace("'", "")
                                Dim x() As String = a.Split(vbCrLf)
                                Dim dir As String = x(0)
                                Dim str As String = x(1)
                                W(dir, str)
                                MsgBox(dir & " " & str)
                            End If
                        End If
                    End If
                Next
            End Using
        End Sub

    End Class

End Namespace
It can be improved to 100 %.
Quote Originally Posted by Hassan View Post


It can be improved to 100 %.
it's 10% done /fp
Posts 16–17 of 17 · Page 2 of 2
This thread is closed for replies.

Tags for this Thread

None

Talk with us