also ich habe ein problem und zwar habe ich ein musik player der die playlist speichern kann nur will ich eine Dateiendung registrieren also das es z.b .lor hat
mit ein icon nur komme ich nicht weiter ...
hier ist der code wie ich zurzeit ohne Dateiendung registrieren speicher
PHP Code:
Dim FileWriter As StreamWriter
Dim results As DialogResult
results = SaveFileDialog1.ShowDialog
If results = DialogResult.OK Then
FileWriter = New StreamWriter(SaveFileDialog1.FileName, False)
For i = 0 To ListBox1.Items.Count - 1
FileWriter.Write(ListBox1.Items.Item(i))
FileWriter.Write(vbNewLine)
Next i
FileWriter.Close()
PHP Code:
Private Function Registerfile(ByVal endung As String, ByVal namedesdateityps As String, ByVal pfadzuprogramm As String, ByVal pfadzuicon As String) As Boolean
Try
Dim objSubKey As Microsoft.Win32.RegistryKey
Dim objSubKey2 As Microsoft.Win32.RegistryKey
Dim Wert As String = "lorem-datei"
Dim sKey As String = ".lor"
Dim sKey2 As String = ".lor\ShellNew"
Dim sEntry As String = "Content Type"
Dim sValue As String = "text/plain"
Dim sEntry2 As String = "PerceivedType"
Dim sValue2 As String = "text"
Dim sEntry3 As String = "Nullfile"
objSubKey = My.Computer.Registry.ClassesRoot.CreateSubKey(sKey)
objSubKey.SetValue("", Wert)
objSubKey.SetValue(sEntry, sValue)
objSubKey.SetValue(sEntry2, ListBox1.Text)
objSubKey2 = My.Computer.Registry.ClassesRoot.CreateSubKey(sKey2)
objSubKey2.SetValue(sEntry3, "")
Dim objSubKey3 As Microsoft.Win32.RegistryKey
Dim sKey3 As String = "lorem-datei"
Dim sKey4 As String = "lorem-datei\shell\open\command"
Dim skey5 As String = "lorem-datei\DefaultIcon"
Dim sValue3 As String = "lorem-datei"
Dim objSubKey5 As Microsoft.Win32.RegistryKey
Dim sValue5 As String = """" + "Lorem - Ipsum.exe" + """" + " %1"
Dim sValue6 As String = """" + "C:\Users\Kevin\Desktop\Pic´s Lorem\music.icon" + """"""
Dim objSubKey4 As Microsoft.Win32.RegistryKey
objSubKey3 = My.Computer.Registry.ClassesRoot.CreateSubKey(sKey3)
objSubKey3.SetValue("", sValue3)
objSubKey4 = My.Computer.Registry.ClassesRoot.CreateSubKey(sKey4)
objSubKey4.SetValue("", sValue5)
objSubKey5 = My.Computer.Registry.ClassesRoot.CreateSubKey(skey5)
objSubKey5.SetValue("", sValue6)
Return True
Catch ex As Exception
Return False
End Try
End Function






.
