|
Hello, I made an application that browse through a list of urls and i was wondering to make it multithread. i need some help with that im a litle confused convining Multithreading with the axwebbrowser events. thanks, Mike
|
|
|
|
|
The webbrowser control will only open one URL at a time. You can't send it multiple URLs from different threads and have them all be retrieved.
The only way around that is to use one webbrowser control for each thread. But, this gets VERY resource intensive. If all you're doing is downloading a single page, without care about any images on that page, then you might want to consider using the much lighter weight HttpWebRequest[^] class to fetch the pages instead.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have a requirement to import data from an Excel spreadsheet file into some legacy software within in a language called Retieve 4GL, which has limited support for non R4GL files. Basically it supports CSV files.
I therefore need to convert an Excel Spreadsheet to a CSV file for importing. I would be greatful for any pointers as I have little experince of Excel integration. Ideally I would write a console app in VB.NET 2005, which I could shell to from R4GL, to convert the excel spreadsheet. Excel 2003 is installed on the PCs which will be running this task.
I guess what I need to do is start an instance of Excel, load the file, then force it to save in as a CSV, or is there a better option.
Thanks in advance for suggestions
Steve Jowett
|
|
|
|
|
This was just cropped from an old VB 6 application, but should get your started in the right direction...
Dim excelapp As New Excel.Application
Dim excelWB As Excel.Workbooks
Set excelapp = Excel.Application
Set excelWB = Excel.Workbooks
excelWB.Application.DisplayAlerts = False
excelWB.Open LTrim(<your file="" path="">), UpdateLinks:=3
excelapp.ActiveWorkbook.SaveAs FileName:= _
"<your file="" name="">" & ".csv", _
FileFormat:=xlCSVMSDOS, CreateBackup:=False
Tim
|
|
|
|
|
Thanks Tim, not difficult when you know how;)
Cheers
Steve Jowett
|
|
|
|
|
I want to test how long it takes to load a form with 150 buttons with a background image(on each button) and test how long it takes to open a form with 150 buttons without a background image(on each button)... I have never worked with a timer control and Im assuming that is what I will want to use. I have built three forms, the first form has two buttons, one to open each of the forms with the buttons. The next form has 150 buttons each with a background image, the last form is the same except each button does not have a background image. That is as far as I have gotten, can someone please explain to me what I need to do from here. Thank you...
|
|
|
|
|
Since this is a test, you don't have to do it perfectly.
Create a global variable called dtBuild as date
Dim oFrm as form1
dtBuild = now
ofrm.show
In the activate event of form1 put this code
MsgBox((Now.Subtract(dtBuild).TotalMilliseconds) / 1000)
-- modified at 11:19 Wednesday 8th November, 2006
|
|
|
|
|
I just get a message box with a zero in it BEFORE the form loads. The msgbox comes up, i click OK and then the form loads... Any ideas????
|
|
|
|
|
Try this instead
1) put a dummy label on your form.
2) dim a variable at the form level
Private dt As Date
3) code activate with the result
Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Label1.Text = (Now.Subtract(dt).TotalMilliseconds / 1000).ToString
End Sub
4) code the handlecreated event with the start of the "timer"
Private Sub Form2_HandleCreated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.HandleCreated
dt = Now
End Sub
|
|
|
|
|
OK cool, that worked, I THINK....
Do you think its possible for a form full of buttons with a background images to load faster than a form with the same amount of buttons that do no have a background image??? because that is what I am getting...
|
|
|
|
|
actually nevermind, it doesnt work. I mean it shows how long it takes for the form and the label to load. The label appears before the buttons all are loaded. I need to to appear after the buttons are loaded...
|
|
|
|
|
how about moving the code from the activate to the paint event...?
|
|
|
|
|
that worked!!! thank you very much for your help...
|
|
|
|
|
I have a datagrid that is not bound to a datasource. I write to the grid by inserting new rows. How can I clear the datagrid so that the inserts begin over again at row 0?
tia!
|
|
|
|
|
I'm guessing but have you tried
grd.Rows.Clear
|
|
|
|
|
Hi,
I am trying to download multiple file names of the same name from 100 differant locations to a single folder on my local server. To avoid over writing the previous file with the same name i want to append the ippaddress of the source file to the file name...... can this be done??
I hope someone can help me - i seem to be chasing my own tail here!!
Regards
Mac
|
|
|
|
|
you should be in total control of what you name the file that will be saved on your harddrive. Do a dns lookup per location to get the ipaddress and append it to the name of the file before you attempt the download. or is there more to it...?
the source may be xxxxxxx.txt but download method should let you rename it to xxxxxxx_999.999.999.999.txt
|
|
|
|
|
I know all of the ip addresses, i just want to automate the renaming to include the ip address it came from. And i have no idea how to do it in VB...
|
|
|
|
|
Pass each location into this function and append the result to the filename.
Ex:
Dim sFile as string = "downloadfile.txt"
sFile = Mid(sFile,Instrrev(sFile,".")-1) & "_" & sGetIP("www.yahoo.com") & _
Mid(sFile,Instrrev(sFile,"."))
sFile will equal "doadloadfile_209.73.186.238.txt"
Private Function sGetIP(ByVal sWebSiteName As String) As String
Dim o As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(sWebSiteName)
Return CType(o.AddressList.GetValue(0), System.Net.IPAddress).ToString.Trim
End Function
|
|
|
|
|
Using vb.net windows application
|
|
|
|
|
A fax is not sent via internet, it's sent via a phone line.
---
b { font-weight: normal; }
|
|
|
|
|
I do believe there are services on the internet that will convert an email to a fax and send it for you, for a cost
Steve Jowett
|
|
|
|
|
|
Not really the right forum for this question, is it? But anyway Real VNC turns off the wallpaper so that it has less data to tranfer to the client PC. It should restore the wallpaper after you termiate the connection.
If you check the setting for Real VNC, you can set an option not to remove the wallpaper and FX etc.
Steve Jowett
|
|
|
|
|
Hi,
I have a multi user application in ASP.NEt (vb.net). I want to put my print operations in a queue so that i can bulk-print at the end of the day. After searching through several engines, i am left with the option to convert the current page to PDF (using 3rd party components), save it in the file system and then execute print at the end of the day.
Do i have any other option besides converting my page to PDF?
Ritesh
|
|
|
|