Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
A

akuma6099

@akuma6099
About
Posts
3
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WebBrowser control, HTTPS SSL certificate security dialog
    A akuma6099

    I look forward to it. I'm sure it will help others. I'm experimenting with the DocumentStream property. So far it's been ok. Not getting what I wanted but still tweaking about. Thanks.

    Visual Basic security csharp com cryptography

  • WebBrowser control, HTTPS SSL certificate security dialog
    A akuma6099

    I'm writing a util that uses a hidden webbrowser control to traverse through a few .aspx pages. These are through an SSL enabled site. I want to accept the certificate and or install it locally instead of the end user clicking on "yes" to accept it. I've googled for quite some time and found 2 different methods. One for .NET 1.1 and .NET 2.0. I cannot get either to work. The dialog still pops up. I am trying to put this into a module. Here's what I have tried.

    Imports System.Net
    Imports System.Net.Security
    Imports System.Security.Cryptography.X509Certificates
    Imports System.Security.Policy

    Module VWeb

    Dim WithEvents WB As New WebBrowser
    Dim ASPComplete As Integer = 0
    Dim LoginURI As New Uri("https://XXX.com/Login.aspx")
    Dim OpenCallsURI As New Uri("https://XXX.com/openCallReport.aspx")
    Dim MainPage As New Uri("https://XXX.com/Default.aspx")
    Dim TestTimer As New Timer()
    

    Public Function LoginAsTech(ByVal UserID As String, ByVal Pass As String) As Boolean
    Dim MyDoc As New mshtml.HTMLDocument
    Dim DocElements As mshtml.IHTMLElementCollection = Nothing
    Dim LoginForm As mshtml.HTMLFormElement = Nothing

        ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateCertificate)
        
        ASPComplete = 0
        WB.Navigate(LoginURI)
        BrowserLoop()
    
        MyDoc = WB.Document.DomDocument
        DocElements = MyDoc.getElementsByTagName("input")
        For Each i As mshtml.IHTMLElement In DocElements
    
            Select Case i.name
                Case "seLogin$UserName"
                    i.value = UserID
                Case "seLogin$Password"
                    i.value = Pass
                Case Else
                    Exit Select
            End Select
    
            frmServiceCalls.txtOut.Text &= i.name & " : " & i.value & " : " & i.type & vbCrLf
        Next i
        'WB.Document.Forms("form1").InvokeMember("submit")
    
    
        LoginForm = MyDoc.forms.item("form1")
        LoginForm.item("seLogin$LoginButton").click()
        ASPComplete = 0
        BrowserLoop()
    
    
    
        MyDoc = WB.Document.DomDocument
        DocElements = MyDoc.getElementsByTagName("input")
        For Each j As mshtml.IHTMLElement In DocElements
            frmServiceCalls.txtOut.Text &= j.name & " : " & j.value & " : " & j.type & vbCrLf
    
        Next j
    
        frmServiceCalls.txtOut.Text &= vbCrLf & vbCrLf & WB.Url.AbsoluteUri & vbCrLf
    
    Visual Basic security csharp com cryptography

  • Padding with NULL char
    A akuma6099

    Hello everybody. I have a file that is spaced with NULL instead of standard spaces. LIKE SO... COMPANYNAME C(NULL)O(NULL)M(NULL)P(NULL)A(NULL)N(NULL)Y(NULL)N(NULL)A(NULL)M(NULL)E(NULL) I'm trying to make a utility that will remove or add the NULL spacing. First I started on the add function. Here's what I have

     Private Sub btnOpenFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
    
            Dim FileName As String = ""
    
            With dlgOpenFile
                .InitialDirectory = "C:\Stuff\Office2K3.SP2"
                .Filter = "All Files|*.*"
            End With
    
            If (dlgOpenFile.ShowDialog = Windows.Forms.DialogResult.OK) Then
    
                FileName = dlgOpenFile.FileName
                'Dim sr As System.IO.StreamReader = Nothing
                'sr = New System.IO.StreamReader(FileName)
                'CurrentFileContents = sr.ReadToEnd
    
                Dim fs As System.IO.FileStream = New System.IO.FileStream(FileName, IO.FileMode.Open, IO.FileAccess.Read)
                Dim strLength As Integer = Convert.ToInt32(fs.Length)
                Dim fileData As Byte() = New Byte(strLength) {}
    
                fs.Read(fileData, 0, strLength)
                fs.Flush()
                fs.Close()
    
                For Each x As Byte In fileData
                    txtOut.Text &= Convert.ToChar(x) & Chr(&H0)
    
                Next x
    
                'For Each x As Char In CurrentFileContents
                'txtOut.Text &= x & vbNullChar
    
                'Next x
    
                'sr.Close()
    
            End If
    
        End Sub
    
        Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
    
            If (CurrentFileContents = "") Then
                btnOpenFile_Click(sender, e)
            End If
    
            Dim null As String = vbNullChar
            Dim newFile As String = ""
            For Each x As Char In CurrentFileContents
                newFile &= x & CStr(vbNullChar)
            Next x
            txtOut.Text = newFile
    
    
        End Sub
    

    I've tried 2 different ways. I tried using a streamreader and dumping the file into a string. Then iterate with a for each loop and append a NULL char after each value. This results in a string with 1 Char in it, the first one "C". If I remove the NULL char, the string will be complete. The other method was using a byte array. This resulted in a dump but without the NULL bytes. I've researched and there is alot of "NULL removal" or "MYSQL and NULL in DateField" but I see nothing on NULL paddi

    Visual Basic mysql data-structures tools
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups