Drak_PT Posted January 13, 2016 at 05:15 PM Report Share #591935 Posted January 13, 2016 at 05:15 PM Boas amigos, gostaria de saber se alguém me pode ajudar a converter este código para c#... Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ClearTextBox(Me) Try Dim aroras As Process = Process.Start(Environment.CurrentDirectory & "\Script1.bat") aroras.WaitForExit() If File.Exists("user.ini") Then Dim words() = {"BSSID", "pin", "(SSID)"} For Each str As String In File.ReadAllLines("user.ini") Dim bssidInt As Integer = str.IndexOf(words(0), StringComparison.Ordinal) If bssidInt <> -1 Then str = str.Remove(bssidInt, words(0).Length) TextBox2.Text = (str.Trim.Remove(0, 2)) End If Dim pinInt As Integer pinInt = str.IndexOf(words(1), StringComparison.Ordinal) If pinInt <> -1 Then pinInt += words(1).Length + 2 TextBox3.Text = (str.Substring(pinInt, 8)) End If Dim SSIDInt As Integer SSIDInt = str.IndexOf(words(2), StringComparison.Ordinal) If SSIDInt <> -1 Then str = str.Remove(SSIDInt, words(2).Length) TextBox1.Text = (str.Trim.Remove(0, 20)) End If Next If TextBox1.Text = "" Then MsgBox("Erro: Usuario não é valido!" + vbNewLine + "Dica: Use outro usuario. Exemplo: (Administrator)") Else //Comando... End If End If Catch ex As Exception MsgBox("Erro: Verifique a sua ligação ao Router!" + vbNewLine + "Dica: Use outro usuario. Exemplo: (Administrator)") End Try End Sub Link to comment Share on other sites More sharing options...
He B TeMy Posted January 13, 2016 at 05:23 PM Report Share #591936 Posted January 13, 2016 at 05:23 PM converter.telerik.com 1 Report Link to comment Share on other sites More sharing options...
Drak_PT Posted January 14, 2016 at 06:49 AM Author Report Share #591951 Posted January 14, 2016 at 06:49 AM (edited) Obrigado pela dica, ja tinha testado mas gerou demasiados erros 😞 Editado: Resolvido... Edited January 14, 2016 at 11:09 AM by Drak_PT Link to comment Share on other sites More sharing options...
kerplunkboy Posted February 17, 2016 at 01:43 AM Report Share #593612 Posted February 17, 2016 at 01:43 AM Somente "erros"? Nenhuma descrição deles? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now