Latest News
Showing posts with label sort. Show all posts
Showing posts with label sort. Show all posts

Recursive File Search in C | Source Code

Posted by genesisdatabase on Saturday, 5 March 2011 , under , , , , , , , , , , , , , , | comments (2)



This source code below is written by se7en from LeetCoders.  It is capable of running through the enter C drive in 8 seconds on my computer finding more than 230,000 files.  Although the downside of it is that it costs quite an amount of CPU usage during its process.  You might try to optimize it by placing Sleep function or something that is possible in reducing the CPU usage.

Sorting Registries in VB .NET

Posted by genesisdatabase on Monday, 26 July 2010 , under , , , , , , , | comments (1)



So there's this guy from http://leetcoders.org that needed some help getting a function created for him to breakup a single string that contains Name, Registry Key and Registry Data and appends the strings into a richtextbox.

AutoCAD 2010|Serial=HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R18.0\ACAD-8001:409\=SerialNumber

to

RichTextBox1.AppendText("Autocad 2010" & vbNewLine)
Dim ammSteal01 As String = Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R18.0\ACAD-8001:409", "SerialNumber", Nothing)
RichTextBox1.AppendText(ammSteal01)


So i created a simple function called
Private Sub AppendStringToRichTextBox2(ByVal str As String, ByVal txtbox As RichTextBox)

which does
[code]
Dim title As String = ""
Dim key As String = ""
Dim data As String = ""

Dim str_arr As String() = str.Split("=")

key = str_arr(1)
data = str_arr(2)

For i = 0 To str_arr(0).Length - 1
If str_arr(0)(i) = "|" Then
Exit For
End If

title += str_arr(0)(i)
Next

txtbox.AppendText(title & vbNewLine)
txtbox.AppendText(Microsoft.Win32.Registry.GetValue(key, data, Nothing))
[/code]

The function generally appends the name of the application and the value of the key that have been called via Registry.GetValue. Well it's nothing hard so port it to your own use if you need it.