CMD-Comment ausführen, aber CMD darf nicht sichtbar sein

  • VB.NET

Es gibt 5 Antworten in diesem Thema. Der letzte Beitrag () ist von Kangaroo.

    CMD-Comment ausführen, aber CMD darf nicht sichtbar sein

    Es gibt ja diese Methode:

    VB.NET-Quellcode

    1. Process.Start(My.Computer.FileSystem.SpecialDirectories.Temp + "\ping.exe", TextBox13.Text + "Anweisung")

    aber da tauscht immer der CMD auf...ich habe mal von einem VB-Code gehört, wo sowas nicht passiert...leider weiß ich auch nicht wonach i googln soll...
    Es gibt eines für c#:
    Hier aus dem Internet umkonvertiert:

    VB.NET-Quellcode

    1. Imports System.Net
    2. Imports System.Net.NetworkInformation
    3. Imports System.Text
    4. Namespace Examples.System.Net.NetworkInformation.PingTest
    5. Public Class PingExample
    6. ' args[0] can be an IPaddress or host name.
    7. Public Shared Sub Main(args As String())
    8. Dim pingSender As New Ping()
    9. Dim options As New PingOptions()
    10. ' Use the default Ttl value which is 128,
    11. ' but change the fragmentation behavior.
    12. options.DontFragment = True
    13. ' Create a buffer of 32 bytes of data to be transmitted.
    14. Dim data As String = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    15. Dim buffer As Byte() = Encoding.ASCII.GetBytes(data)
    16. Dim timeout As Integer = 120
    17. Dim reply As PingReply = pingSender.Send(args(0), timeout, buffer, options)
    18. If reply.Status = IPStatus.Success Then
    19. Console.WriteLine("Address: {0}", reply.Address.ToString())
    20. Console.WriteLine("RoundTrip time: {0}", reply.RoundtripTime)
    21. Console.WriteLine("Time to live: {0}", reply.Options.Ttl)
    22. Console.WriteLine("Don't fragment: {0}", reply.Options.DontFragment)
    23. Console.WriteLine("Buffer size: {0}", reply.Buffer.Length)
    24. End If
    25. End Sub
    26. End Class
    27. End Namespace


    lg
    ScheduleLib 0.0.1.0
    Kleine Lib zum Anlaufen von Code zu bestimmten Zeiten