Jump to content


Check out our Community Blogs

kresh7

Member Since 27 Jun 2007
Offline Last Active Aug 13 2010 09:17 AM
-----

Topics I've Started

[VB.NET]mInetInfo

09 February 2010 - 05:40 PM

Ok here this is just a small function that retrieves some Internet Explorer information shows you your proxy settings,proxy enabled or not,and your useragent some easy registry keys which get read here is it.

Option Explicit On
Imports Microsoft.Win32.RegistryKey
'---------------------------------------------------------------------------------------
' Module      : mInetInfo
' DateTime    : 09/02/2010  05:18AM
' Author      : Kreshnik Hasanaj
' Mail        : [email]kresha7@hotmail.com[/email]
' Purpose     : Retrieve some Internet Settings 
' Use         : On your own risk
'---------------------------------------------------------------------------------------
Module mInetInfo
    Public Function GetProxySettings() As String
        Dim RegKey As String
        RegKey = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", Nothing)
        RegKey = Replace(RegKey, ";", vbNewLine)
        GetProxySettings = RegKey
    End Function
    Public Function IsProxyEnabled() As Boolean
        Dim RegKey As String
        RegKey = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", Nothing)
        IsProxyEnabled = CBool(RegKey)
    End Function
    Public Function InetUserAgent() As String
        Dim RegKey As String
        RegKey = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "User Agent", Nothing)
        InetUserAgent = RegKey
    End Function
End Module

[VB.NET] RemIECAPass

09 February 2010 - 05:35 PM

Okay Hi all :D it's me Kresha haven't been for long online on codecall that's because i'm trying to get dumber on university :D.So i'm trying to learn a little VB.NET and i have made a thew functions which i'm going to post today this first was really easy to make the code yes but it took some time to understand what/where
it's a function which removes the Internet Explorer content advisory password so you can reset it and here you go here is it.
'---------------------------------------------------------------------------------------
' Function    : RemIECAPass
' DateTime    : 09/02/2010  17:20PM
' Author      : Kreshnik Hasanaj
' Mail        : kresha7@hotmail.com
' Purpose     : Removes Internet Explorer Contents Advisory 
'---------------------------------------------------------------------------------------
Public Sub RemIECAPass()
Try
            My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Ratings", True).DeleteValue("Key")
        Catch ErrReg As Exception
        End Try
End Sub

[VB6]ProperCase String

29 September 2009 - 08:05 AM

Ok 3 Days ago i was playing with one of my old functions that i have used in some of my applications and while my skills have grown i made the function much smaller and i can make it even more smaller but this looks good atm
ok i know that this function is already impremented in visual basic 6 but if you want be a good coder you should try to code your functions alone

ok this function helps you show every first letter behind a space in uppercase

sorry for my bad english :D

Public Function ProperCaseString(StringWithSpaces As String)
    
    Dim TheName()  As String
    Dim TheAName() As String
    Dim TheFinal   As String
    Dim i          As Long
    
    TheName() = Split(StringWithSpaces, " ")
    TheAName() = Split(StringWithSpaces, " ")

    For i = 0 To UBound(TheName)
    
        TheName(i) = UCase$(Left$(TheName(i), 1))
        TheAName(i) = Right$(TheAName(i), Len(TheAName(i)) - 1)
        TheFinal = TheFinal & TheName(i) & TheAName(i) & " "
    Next

    ProperCaseString = TheFinal

End Function

[VB6]Extract Extention from File

27 September 2009 - 02:05 PM

Ok while ago ive coded this function it extracts the extention of a file so i thought lets post it here to maybe someone could need this Credit if u use it :D Peace out


Public Function ExtractFileExtention(FilePath As String)
    On Error GoTo **
    Dim i    As Integer
    Dim TPos As String

    For i = 0 To Len(FilePath) + 1

        TPos = Right$(FilePath, i)

        If InStr(1, TPos, ".") Then
            ExtractFileExtention = Right$(FilePath, Len(TPos))
            Exit Function
        End If

    Next

**:
    MsgBox "Application Error", vbInformation, "Error"
    Exit Function
End Function

[VB6]GetProcessID using PEB (Process Enviroment Block)

25 September 2009 - 07:15 AM

Ok Days ago i did this function to get The ProcessID using PEB by reading THE FS = Segment Registry on position 0x20

Option Explicit
Private Declare Function NtCurrentTeb Lib "NTDLL" () As Long
Private Declare Sub CopyMemory _
                Lib "kernel32" _
                Alias "RtlMoveMemory" (pDst As Any, _
                                       pSrc As Any, _
                                       ByVal ByteLen As Long)
Private Declare Sub GetMem4 Lib "MSVBVM60" (ByVal Addr As Long, ByRef RetVal As Long)

Public Function GetProIDbyGetMem4() As Long
    Dim MemBuffer As Long
    Call GetMem4(NtCurrentTeb + &H20&, MemBuffer)
    GetProIDbyGetMem4 = MemBuffer
End Function

Hope this comes handle for anyone of you guys

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download