vb.net to c#
Prikazujem rezultate 1 do 5 od 5

Tema: vb.net to c#

  1. #1
    Početnik
    Učlanjen
    28.03.2009.
    Pol
    muški
    Poruke
    10
    Reputaciona moć
    0

    Podrazumevano vb.net to c#

    Treba mi neko ko bi mogao ovo da prevede u c#
    ja sam pokusavao ali mi ne ide od ruke tnx unapred


    Kod:
    Imports System.IO
    Imports System.Environment
    Imports System.Reflection
    Imports System.Runtime.InteropServices
    
    
    Public Class Form1
    
        Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim installpath As String = String.Empty
            installpath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", Nothing)
            Dim fs As New FileStream(installpath & "realmlist.wtf", FileMode.Create, FileAccess.Write)
            Dim s As New StreamWriter(fs)
            s.WriteLine("set realmlist eu.logon.worldofwarcraft.com")
            s.Close()
    
            Dim ss As String = startgame("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", "WoW.exe")
    
            If ss <> String.Empty Then
                My.Settings.wow = ss
                My.Settings.Save()
            End If
        End Sub
    
        Private Function startgame(ByVal RegPath As String, ByVal RegValue As String, ByVal ExeFile As String) As String
            Dim retval
            Dim installpath As String = String.Empty
            installpath = My.Computer.Registry.GetValue(RegPath, RegValue, Nothing)
            If Directory.Exists(installpath) Then
    
                ChDir(installpath)
                retval = Shell(ExeFile, 1)
            Else
                With OpenFileDialog1
                    .InitialDirectory = GetFolderPath(Environment.SpecialFolder.ProgramFiles)
                    .Title = "Please Select " & ExeFile
                    .Filter = "Windows Executable *.Exe|*.exe"
                    .FileName = ExeFile
                    If .ShowDialog() = Windows.Forms.DialogResult.OK Then
                        Process.Start(.FileName)
                        Return .FileName
                    End If
    
                    Me.Close()
    
    
                End With
    
    
            End If
    
            Return String.Empty
        End Function
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Environment.GetEnvironmentVariable("temp")
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Dim installpath As String = String.Empty
            installpath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", Nothing)
            If Directory.Exists(installpath & "/cache") Then
                Directory.Delete(installpath & "/cache", True)
                MsgBox("Cache deleted successfully")
            Else
                MsgBox("There is no cache")
            End If
        End Sub
    End Class



  2. #2
    Ističe se
    Učlanjen
    01.07.2004.
    Pol
    muški
    Lokacija
    Nis
    Poruke
    2.774
    Reputaciona moć
    78

    Podrazumevano Re: vb.net to c#

    Sta ti je konkretno problem?
    Čiste ruke
    Hladna glava
    I vatreno srce

  3. #3
    Početnik
    Učlanjen
    28.03.2009.
    Pol
    muški
    Poruke
    10
    Reputaciona moć
    0

    Podrazumevano Re: vb.net to c#

    Kod:
    installpath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\blizzard entertainment\world of warcraft", "installpath", Nothing)
    konkretno to mi je problem kako da potrazim nesto u registry

  4. #4
    Ističe se
    Učlanjen
    01.07.2004.
    Pol
    muški
    Lokacija
    Nis
    Poruke
    2.774
    Reputaciona moć
    78

    Podrazumevano Re: vb.net to c#

    http://www.csharphelp.com/archives2/archive430.html

    http://www.csharphelp.com/archives2/archive392.html

    Da li je toliko tesko da se u google ukuca "C# Registry get value"?
    Čiste ruke
    Hladna glava
    I vatreno srce

  5. #5
    Početnik
    Učlanjen
    28.03.2009.
    Pol
    muški
    Poruke
    10
    Reputaciona moć
    0

    Podrazumevano Re: vb.net to c#

    nije al coveku kad treba nesto on se tad najteze seti btw tnx

Pravila za slanje poruka

  • Ne možete kreirati novu temu
  • Ne možete poslati odgovor
  • Ne možete dodati priloge
  • Ne možete prepraviti svoju poruku
  •