Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all 27108 articles
Browse latest View live

VS 2010 Get all tags from HTML file

$
0
0
I'm picking back up on my web IDE project again and one of the things that I want to do is get all the HTML elements in a file that the user would be editing. The file would be just the contents of a Richtextbox and what I was thinking was by just using RegEx to get all the tags. The thing that gets me is that this is the same thing:
HTML Code:

<input type="button"></input>
HTML Code:

<input type="button" />
But require different RegEx patters. What is something that y'all would suggest?

Compare datagrid value to query value before save

$
0
0
I have DataGridView:
ProductID | Quantity | Price

Before I save to database I need to compare the Quantity for each ProductID to be lower than the Stock-Qty retrived by a query, like this:

Dim Con As New OleDbConnection
Con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\Database.accdb"
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter

Dim Cmdx As Boolean
Cmdx = 1
Try
For k = 0 To MSDataGridView.RowCount - 1
da = New OleDbDataAdapter("SELECT .....Where ProductID = " & MSDataGridViewCurrentRow.Cells("ProductID").Value & , Con)
If MSDataGridView.Item(1, k).Value) < da Then
NirBindingNavigatorSaveItem.Visible = True

Else

MsgBox("The Quantity is higher than the stock")
Cmdx = 0
End If
Next

VS 2012 Restart application

$
0
0
I have tried two different way but the result is the same. All I need is to close the application and restart.

Code:

Application.Restart()
and

Code:

Application.Exit()
Process.Start(Application.ExecutablePath)

Both close the application but does not restart it.

VS 2010 forms and objects changing sizes and locations on certain computers

$
0
0
I am having a strange problem with one of my applications. I have some more complicated forms that are built into the application and are called when needed while other less complicated forms i build with code when they are called. My problem is while debugging and/or running the installed version on my machine works fine, as do most other machines, certain users are experiencing problems with text font sizes, buttons sizes and locations, label sizes and locations, form sizes etc... not appearing on the forms correctly. I am having users maximize the form so they can see the "save" or "cancel" buttons on some forms. Other forms have rich text boxes that display terminal outputs and the leftmost text is being cut off... any ideas how to fix this?

Help with mysql command text

$
0
0
Hi i trying to make that mysql column delete but it seems there is an error :| WHERE!!

Code:

cmd.CommandText = "ALTER TABLE 'buildings' DROP '" & Form1.PlayerName & "' WHERE ID = 1"
dr = cmd.ExecuteReader

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''buildings' DROP 'ign__' WHERE ID = 1' at line 1

The colum exist

Change Sql vlaues through datagridview

$
0
0
Hi all,

I've got this problem which is driving me crazy!

I have a datagridview and I set a BindingSource to it, the problem is this when I change an existing record all the other records get the same values!!

Ex: Robert - 21 - Male - Married
Rebecca - 19 - Woman - Single

If in the second record i change "19" to "20" this is what i get

Rebecca - 20 - Woman - Single
Rebecca - 20 - Woman - Single

it duplicates my record!

Here is my code:
Command = New SqlCommand("update Agency set Name = @Name, Age = @Age, Sex = @Sex, [Marital Status]=@Mstatus

With Command.Parameters
.Add(New SqlParameter("@Name", DataGridView1.CurrentRow.Cells(0).Value.ToString()))
.Add(New SqlParameter("@Age", DataGridView1.CurrentRow.Cells(1).Value.ToString()))
.Add(New SqlParameter("@Sex", DataGridView1.CurrentRow.Cells(2).Value.ToString()))
.Add(New SqlParameter("@Mstatus", DataGridView1.CurrentRow.Cells(3).Value.ToString()))
End With

I tried all also adding a For i = 0 to DataGridView1.SelectedRows.Count -1
For i = 0 to DatagridView1.SelectCells.Count -1

i tried also: @Name, DataGridView1.Row(i).Cells(0) and inverting the 0 and i

It keeps acting Always same way, please I need your help and I wish to all you all the best in your lives!

VS 2010 How to use google API with iframes in vb.net

$
0
0
Ok, so I will repost my question incase someone else is wondering. Basicly I want to use google maps API in my form because it allows customization of the map for your end user. You have to signup for a free key.
https://developers.google.com/maps/d...on/embed/guide
I originally was asking how to just use the API url in the form in the web browser, without the link to the map being imbedded into some HTML, problem is, it only responds in the webbrowser form with "Must be in iforms" or something like that. What I realized was that I had to build up folders on my hard drive with HTML in them and paste an iframe section in each one, then call the html document in the forms web browser to get around this. It didnt take long and I learned that the advantage to the iframe is that only the area inside of the iframe refreshes when you click on a link in it, not the entire web browser.

HTML Code:

Sample iFrame: (from http://manda.com/iframe/)

<html><head>
<title>Iframe Tutorial</title>
</head>

<body>
<font face="verdana,arial" size="3">
<div align="center">
<p>

<a href="http://www.altavista.com" target="iframe1">AltaVista.com</a> |
<a href="http://www.aol.com" target="iframe1">AOL.com</a> |
<a href="http://www.lycos.com" target="iframe1">Lycos.com</a> |
<a href="http://www.yahoo.com" target="iframe1">Yahoo.com</a>

<p>
<iframe
name="iframe1"
width="600"
height="400"
src="http://www.yahoo.com"
frameborder="yes"
scrolling="yes">

</iframe>
<p>

</font>
</div>

<!--
name="iframe1"
- Set all links to target the iframe1 name when you want the contents of the iframe to change from links on the originating page.

width="600" - Width of the iframe

height="400" - Height of the iframe * Width and height can be expressed in pixels or percent

src="http://www.yahoo.com" - Initial page that will fill in the iframe

frameborder="yes" - Border around the iframe is displayed by default

scrolling="yes" - Allow scrollbars around the iframe for navigation Vaild values are yes, no and auto

align="" - Valid entries are left and right left is set by default
-->


</body>
</html>

Gradebook Creation

$
0
0
I need help doing this assignment. A Gradebook needs to be created by reading a .cvs file.
If a student has more than 100 points in a hw the value will be set to 100 (max possible is only 100).

If the field is blank then set it to 0.
Calculate the average homework grade and assign a letter grade (ABCDEF)

Based on the letter grade chosen, the list of students who obtained that grade will be shown.

How do I even begin to get my program to read the file?

VS 2010 [RESOLVED] Simple Image Gallery in VB 2010

$
0
0
Hi,

First off, I am pretty useless at programming as I am quite new to it but have to do a computing project for college. Although it won't get me any extra marks, I'm wanting to add an image gallery so that he user can upload an image so that multiple images can be seen on one page.

After searching the internet, I found this link which is pretty much the perfect thing that I want. http://www.authorcode.com/image-gallery-in-vb-net/

I have tried to follow these instructions but many errors have come up which I don't know how to fix. I have included the screenshots of the errors below.

Name:  Gallery Errors.jpg
Views: 76
Size:  34.4 KB

If anyone has any ideas how to fix these errors or any alternate methods, I would be very grateful if you could give me some advice.

Thanks in advance
Attached Images
 

How to Show a Form(in Project-B that prints Crystal Reports) in Project-A in vb 2010

$
0
0
Using VB 2010 and Crystal Report 2011.

I have a Project (Project-B) that contains a Form that prints several Crystal Reports from different Tables in a Database.

In my main Application (Project-A), I would like to do a ShowDialog that would print a Report located in Project-B.

How is the best way to Accomplish this?

Why? I may need to modify the Crystal Reports and don't want to have to recompile and reinstall my main application.

VS 2010 user database

$
0
0
Hi, I am currently working on a project and I have some questions aswell as some issues that I want to be resolved.
First of all, I am going to give some additional information about my project so that the meaning if it becomes clear.

The project is based on an imaginary enterprise, it delivers computerparts and leases servers. The project is connected to an Access 2007 database. the database has different tables calles users, customers, products and suppliers. each table has records with an id. But for this thread I am going to focus on the users table, this one has the following fields:

  • id
  • username
  • password
  • first name
  • last name

Name:  access.png
Views: 35
Size:  5.2 KB

Now in the project I have set up my connection with the database and I already have made the login form, although that I have 1 small question in it.
here is the code:

Code:

Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        If txtUsername.Text = "" Or txtPassword.Text = "" Then
            MessageBox.Show("please fill in the required fields.", "Authentication error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        Else
            Dim conn As New System.Data.OleDb.OleDbConnection()
            conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\User\Desktop\VBproject\access\GipDB.accdb;Persist Security Info=True;Jet OLEDB:Database Password=********"
            Try
                Dim sql As String = "SELECT * FROM users WHERE username='" & txtUsername.Text & "' AND password = '" & txtPassword.Text & "'"
                Dim sqlCom As New System.Data.OleDb.OleDbCommand(sql)
                sqlCom.Connection = conn
                conn.Open()
                Dim sqlRead As System.Data.OleDb.OleDbDataReader = sqlCom.ExecuteReader()
                If sqlRead.Read() Then
                    'frmMainForm.Show()
                    MessageBox.Show(GlobalVars.Username & " " & GlobalVars.firstname & " " & GlobalVars.lastname, "info", MessageBoxButtons.OK, MessageBoxIcon.Information)
                    Me.Hide()
                Else
                    MessageBox.Show("Username and password do not match.", "Authentication faillure", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
                    txtPassword.Clear()
                    txtUsername.Clear()
                    txtUsername.Focus()
                End If
            Catch ex As Exception
                MessageBox.Show("Failed to connect to Database. System Error Message:  " & ex.Message, "Database Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
            End Try
        End If
    End Sub

The question is the following: after the "If sqlRead.Read() Then" I want to insert certain values of the recordset into the following GlobalVars: username, firstname and lastname, all these variables are public declared in a Module. After that, the variables will be shown in the messagebox that follows after it.

the second part of this thread will be focused on the register form, the name explains it already, I want the user to be able to register himself inside the program. the record also has the following fields: id, username, password, firstname, lastname. But I couldn't find anything to my liking on the internet. if you want to help me with this quetion, you may use this to start, you can base your code on my code, mentionned above:

Code:

Private Sub btnSignup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSignup.Click
end sub

Thanks in advance
P.S. Sorry for my bad english, as it is not my native language.
Attached Images
 

Help with IF statement

$
0
0
I have been trying to figure out a way to complete the last part of this assignment. I am having difficulties coding when I have to put into account per month fee + additional hours - discount fees as shown on the last part of my code. I am hoping someone can help me out.

This is the assignment: An internet service provider offers three subscription packages plus a discount fo nonprofit organizations.
a. Package A: 10 hours of access for $9.95 per month. Additional hours are $2.00 per hour.
b. Package B: 20 hours of access for $14.95 per month. Additonal hours are $1.00 per hour.
c. PackageC: Unlimited access for $19.95 per month.
d. Nonprofit Organizations: THe service provider gives all nonprofit organizations a 20 % discount on all packages.
The user should select a package the customer has purchased (from a set of radio buttons) and enter the number of hours used. A check box captioned Nonprofit should also appear on the form. The application should calculate and display the total amount due. If user selects Nonprofit organization check box, a 20% discount should be deducted.
Input validation: the number of hours used in a month cannot exceed 744. The value must be numeric.

Code:

  Private Sub CalculateButton_Click(sender As Object, e As EventArgs) Handles CalculateButton.Click
        'Input Fields
        Dim HoursUsedInteger As Integer
        Dim DiscountCheckboxDecimal As Decimal

        'Output Fields
        Dim AdditionalHoursFee As Decimal
        Dim AmountDueDecimal As Decimal

        'check the number of hours for non integer entrees and send focus to Total hours
        If Not Integer.TryParse(HoursUsedTextbox.Text, HoursUsedInteger) Then
            MessageBox.Show(" No input found or Hours Used must be in integer form")
            HoursUsedTextbox.Text = String.Empty
            HoursUsedTextbox.Focus()
            Return
        End If

        'Validate Hours in a Month
        If HoursUsedInteger < 1 Or HoursUsedInteger > 744 Then
            MessageBox.Show("Total Hours in a month be below 1 or cannot exceed 744")
            HoursUsedTextbox.Text = String.Empty
            HoursUsedTextbox.Focus()
            Return
        End If


        'Calculate Monthly fee.
        If PackageARadio.Checked = True Then
            AmountDueDecimal = 9.95
        ElseIf PackageBRadio.Checked = True Then
            AmountDueDecimal = 14.95
        ElseIf PackageCRadio.Checked = True Then
            AmountDueDecimal = 19.95
        End If

        'Calculate Additional Hours
        If PackageARadio.Checked = True And HoursUsedInteger > 10 Then
            AmountDueDecimal = 9.95 + (HoursUsedInteger - 10) * 2
        ElseIf PackageBRadio.Checked = True And HoursUsedInteger > 20 Then
            AmountDueDecimal = 14.95 + (HoursUsedInteger - 20) * 1
        End If

        'Calculate Discounts
        If NonprofitCheckbox.Checked = True Then
            If PackageARadio.Checked = True Then
                DiscountCheckboxDecimal = 9.95 * 0.2D
                AmountDueDecimal = 9.95 - DiscountCheckboxDecimal
            ElseIf PackageBRadio.Checked = True Then
                DiscountCheckboxDecimal = 14.95 * 0.2D
                AmountDueDecimal = 14.95 - DiscountCheckboxDecimal
            ElseIf PackageCRadio.Checked = True Then
                DiscountCheckboxDecimal = 19.95 * 0.2D
                AmountDueDecimal = 19.95 - DiscountCheckboxDecimal
            End If
        End If
        'Calculate Discounts with additional hour fees
        If NonprofitCheckbox.Checked = True Then
            If PackageARadio.Checked = True And HoursUsedInteger > 10 Then
                AmountDueDecimal = (9.95 + hou
                AmountDueDecimal = AmountDueDecimal * 0.2D
            ElseIf PackageBRadio.Checked = True And HoursUsedInteger > 20 Then
                AdditionalHoursFee = 14.95 + (HoursUsedInteger - 20) * 1
                AmountDueDecimal = AmountDueDecimal * 0.2D
            End If
        End If

        'display the fees
        Amountduelabel.Text = AmountDueDecimal.ToString("c")

VS 2013 UTC Time

$
0
0
I have a label and I want it to display only the UTC time in a HH:MM:SS 24-hour format.

I figured that something like this works:
Code:

Label1.Text = TimeOfDay.ToUniversalTime
However, it displays the time in a 12-hour format with a random date in front of it (1/2/0001).

Any help is appreciated.

Difficulty removing tooltips

$
0
0
Hi all,

I've dynamically created many button objects, and have the option of letting the user assign a tooltip to any given button.

There are times when I need to also:

1 - Remove the tooltip

2 - Change the tooltip

I may be just as happy to only do #2, by changing the tooltip to "", but I think I would like to know how to do both.

Here I am using a "clear" ContextMenuStrip to try to set the tooltip to "", but this seems to do nothing (and throws no error).

Code:

   
'Here is where I create the tooltip by clicking on the button
Private Sub TrayButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)

    Dim toolTip1 As New ToolTip()
    Dim B As Button = sender

    If InStr(B.Name, "TrayButton") > 0 Then
        IsCreated(B.Tag) = True
        toolTip1.SetToolTip(sender, "Custom ToolTip"
    End If
End Sub



'here is where I try to reset the tooltip to "" (context menu whilst right clicking)
Private Sub ClearToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ClearToolStripMenuItem.Click
        Dim myItem As ToolStripMenuItem = CType(sender, ToolStripMenuItem)
        Dim cms As ContextMenuStrip = CType(myItem.Owner, ContextMenuStrip)

        'set the tooltip to ""
        ToolTip1.SetToolTip(cms.SourceControl, "")

End Sub

thank you for your kind help!

R

IF statement with Time

$
0
0
I am having difficulty to make an IF statement work properly.
I am trying to do a limit of how often a user can do a search
Example of my database:

Search Date
6 23/01/2014 07:39:15
2 23/01/2014 07:39:28
1 23/01/2014 07:39:40
1 23/01/2014 07:41:15

Condition:
If True Then
If user has done more than 10 searches in the last 150secs then
CODE
If False then
Code

In the above database example condition will be true.

Any help will be appreciated.

Thanks

Lisa

VS 2010 file rename

$
0
0
I am looking to take a file regardless of it's name and rename it to "BRegister.xlsx" then delete the original file. The file will always be in the same folder and there will only be 1 file at a time. Any help would be appreciated.

[RESOLVED] Unable to Display data from Multiple Tables in VB2010/CrystalReports 2011

$
0
0
Able to print data using one Table just fine.

When I added the second table, nothing prints.

What am I doing wrong? I've researched this with no success. (Nothing wrong with the connection string).


Problem Code:
  1. Private Sub CrystalReportViewer1_Load(sender As System.Object, e As System.EventArgs) Handles CrystalReportViewer1.Load
  2.         Try
  3.             Cursor = Cursors.WaitCursor
  4.             Dim sMyConnectionString As String = "Data Source=NewAbcLaptop\SqlExpress; " _
  5.                 & "Database=C:\Program Files\Microsoft Sql Server\MSSQL10.SqlExpress\MSSQL\DATA\AbcDatabase.mdf; " _
  6.                 & "User Id=Abc2; Password=Abc2password;"
  7.  
  8.             Dim conn As SqlConnection = New SqlConnection()
  9.             conn.ConnectionString = sMyConnectionString
  10.             conn.Open()
  11.  
  12.             Dim da As SqlDataAdapter = New SqlDataAdapter("select ProspectTable.PBuyLN,DealershipTable.DlrName " _
  13.                     & "from ProspectTable,DealershipTable where ProspectTable.PDlrKey2=DealershipTable.DlrKey", conn)
  14.  
  15.             Dim ProsDlrDataSet As DataSet = New DataSet()
  16.             da.Fill(ProsDlrDataSet, "ProspectTable, DealershipTable")
  17.  
  18.             conn.Close()
  19.            
  20.             Dim cr As New ProsDlrWkShtCryRpt
  21.             cr.SetDataSource(ProsDlrDataSet)
  22.             CrystalReportViewer1.ReportSource = cr
  23.             Cursor = Cursors.Default
  24.  
  25.         Catch ex As Exception
  26.             Beep()
  27.             MsgBox("Error in frmProsFormsCryRpts  " & ex.Message)
  28.         End Try
  29.     End Sub

VS 2010 click elements

$
0
0
Hello all,

I try to make a software to spare some time with publishing advertisments.
Now i'm busy to automatically press categories and then fill some information.
The code below is working a little bit.
Its going through the categories and then at the next page it does not fill the information.
Like title, description.
However if i change wait(100) with MsgBox() it does fill in the information but i get tons of message boxes.

Can somebody help me out..
Thank you!


Code:

    Private Sub button_add_publiceer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_add_publiceer.Click
        webbrowser_global.ScriptErrorsSuppressed = True
        webbrowser_global.Navigate("https://www.marktplaats.nl/syi/plaatsAdvertentie.html")
        PublishStatus = 2
    End Sub
    Private Sub webbrowser_global_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webbrowser_global.DocumentCompleted
        ' you'll want to put some sort of test for the appropriate page in here
        ' no point running the timer when it's not needed
        If webbrowser_global.Url = New Uri("https://www.marktplaats.nl/syi/plaatsAdvertentie.html") And PublishStatus = 2 Then
            SelectionTimer.Start()
        End If
    End Sub
    Private Sub SelectionTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectionTimer.Tick
        ' no point in running through every tag on the page so limit to <li>
        Dim clickdone As String = "0"
        Dim nextpage As String = "No"
        For Each el As HtmlElement In webbrowser_global.Document.GetElementsByTagName("div")
            If el.GetAttribute("id") = "syi-categories-l1" And clickdone = "0" Then  ' find the ul
                For Each elchild As HtmlElement In el.GetElementsByTagName("ul")
                    If elchild.GetAttribute("classname") = "listbox item-frame" And clickdone = "0" Then
                        For Each elchild2 As HtmlElement In elchild.GetElementsByTagName("li")
                            If elchild2.GetAttribute("data-val") = combobox_add_categorienr.Text And clickdone = "0" Then ' category
                                elchild2.InvokeMember("Click")
                                clickdone = "1"
                            End If
                        Next
                    End If
                Next
            End If
            If el.GetAttribute("id") = "syi-categories-bucket" And clickdone = "1" Then  ' find the ul
                For Each elchild As HtmlElement In el.GetElementsByTagName("ul")
                    If elchild.GetAttribute("classname") = "listbox item-frame" Then
                        For Each elchild2 As HtmlElement In elchild.GetElementsByTagName("li")
                            If elchild2.GetAttribute("data-val") = combobox_add_subcategorienr.Text Then ' category
                                elchild2.InvokeMember("Click")
                                clickdone = "2"
                            End If
                        Next
                    End If
                Next
            End If
            If el.GetAttribute("id") = "syi-categories-l2" And clickdone = "2" Then  ' find the ul
                For Each elchild As HtmlElement In el.GetElementsByTagName("ul")
                    If elchild.GetAttribute("classname") = "listbox item-frame" Then
                        For Each elchild2 As HtmlElement In elchild.GetElementsByTagName("li")
                            If elchild2.GetAttribute("data-val") = combobox_add_subcategorie2nr.Text Then ' category
                                elchild2.InvokeMember("Click")
                                clickdone = "3"
                            End If
                        Next
                    End If
                Next
            End If
        Next

        If webbrowser_global.ReadyState = 4 Then
            Dim prijstypeid As String = ""
            If combobox_add_prijstype.Text = "Vaste prijs" Then
                prijstypeid = "fixed-price"
            Else
                If combobox_add_prijstype.Text = "Vrij bieden toestaan" Then
                    prijstypeid = "free-bidding"
                Else
                    If combobox_add_prijstype.Text = "Bieden vanaf vraagprijs" Then
                        prijstypeid = "bid-higher"
                    End If
                End If
            End If

            If webbrowser_global.ReadyState = 4 Then
                For Each el As HtmlElement In webbrowser_global.Document.GetElementsByTagName("input")
                    If el.GetAttribute("name") = "title" Then  ' find the ul
                        webbrowser_global.Document.GetElementById("title").SetAttribute("value", textbox_add_titel.Text)
                    End If
                Next
                SetTinyContent(webbrowser_global, textbox_add_omschrijving.Text)
                webbrowser_global.Document.InvokeScript("tinyMCE.activeEditor.setContent('');")
                For Each el As HtmlElement In webbrowser_global.Document.GetElementsByTagName("input")
                    If el.GetAttribute("name") = "price.value" Then  ' find the ul
                        webbrowser_global.Document.GetElementById("price.value").SetAttribute("value", textbox_add_prijs.Text)
                    End If
                Next

                For Each el As HtmlElement In webbrowser_global.Document.GetElementsByTagName("div")
                    If el.GetAttribute("classname") = "form-field" Then  ' find the ul
                        For Each elchild As HtmlElement In el.GetElementsByTagName("span")
                            If elchild.GetAttribute("id") = "syi-attribute-321" Then
                                For Each elchild2 As HtmlElement In elchild.GetElementsByTagName("ul")
                                    For Each elchild3 As HtmlElement In elchild2.GetElementsByTagName("li")
                                        If elchild3.InnerText = combobox_add_conditie.Text Then
                                            elchild3.InvokeMember("Click")
                                        End If
                                    Next
                                Next
                            End If
                        Next
                    End If
                Next
                For Each el As HtmlElement In webbrowser_global.Document.GetElementsByTagName("div")
                    If el.GetAttribute("id") = "syi-price" Then  ' find the ul
                        For Each elchild As HtmlElement In el.GetElementsByTagName("p")
                            If elchild.GetAttribute("classname") = "form-field syi-bidding-radio-buttons" Then
                                For Each elchild2 As HtmlElement In elchild.GetElementsByTagName("span")
                                    For Each elchild3 As HtmlElement In elchild2.GetElementsByTagName("input")
                                        If elchild3.GetAttribute("id") = prijstypeid Then
                                            elchild3.InvokeMember("Click")
                                        End If
                                    Next
                                Next
                            End If
                        Next
                    End If
                Next
                For Each el As HtmlElement In webbrowser_global.Document.GetElementsByTagName("div")
                    If el.GetAttribute("classname") = "form-field" Then  ' find the ul
                        For Each elchild As HtmlElement In el.GetElementsByTagName("span")
                            If elchild.GetAttribute("id") = "delivery-options" Then
                                For Each elchild2 As HtmlElement In elchild.GetElementsByTagName("ul")
                                    For Each elchild3 As HtmlElement In elchild2.GetElementsByTagName("li")
                                        If elchild3.InnerText = combobox_add_leveringsvoorkeur.Text Then
                                            elchild3.InvokeMember("Click")
                                        End If
                                    Next
                                Next
                            End If
                        Next
                    End If
                Next
                For Each el As HtmlElement In webbrowser_global.Document.GetElementsByTagName("div")
                    If el.GetAttribute("id") = "uploader-container-0" Then
                        el.InvokeMember("Click")
                    End If
                Next
            End If
            wait(100)
            PublishStatus = 0
            SelectionTimer.Stop()
        End If
    End Sub

VS 2010 [HELP]Extract specific text from a webpage

$
0
0
Ok so I have webpage. I want to extract specific text from it. Tried lots of solutions but they extract things from the HTML source code, and i want to extract the text from the "live page". Tried with the webbrowser, but it gives a COM error : "Error HRESULT E_FAIL has been returned from a call to a COM component."

Some help please?

New Window GeckoFX 1.9.1.0

$
0
0
I've got a question. I'm trying to build a GeckoFX web browser program using Visual Studio 10. I have everything running but I need for popup windows to open up when you click on a link that opens in a new window. What code(s) is used for this were do you put the code at? I'm pretty new to the programming world as you can see!! Please let me know if you need more details!
Viewing all 27108 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>