|
No, no, no... You don't pass in an .EXE. You just give it the "mailto:" line!
objProcess = New Process
objProcess.Start("mailto:microuser@gmail.com")
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am trying to download files in VB 2005 Asynchronously (To avoid UI JAM) , I need to post the filename to the server and the file is being supplied as server response. Pls. guide. This is what I am currrently using but its OK for Text, Html files.
Public Sub PostData(ByVal strURL As String, Optional ByVal POST1 As String = "")
' Declare a variable named client of type WebClient.
Dim myWebClient As WebClient
' Instantiate a WebClient object and assign it to the 'client' variable.
myWebClient = New WebClient
' Add handler to process theWebClient's DownloadProgressChanged events.
AddHandler myWebClient.UploadProgressChanged, AddressOf UploadProgress
' Add handler to process theWebClient's DownloadCompleted event.
AddHandler myWebClient.UploadStringCompleted, AddressOf UploadCompleted
' Declare a variable named downloadUri of type Uri
Dim downloadUri As Uri
' Instantiate a new Uri object and assign it to the 'downloadUri' variable.
downloadUri = New Uri(strURL)
myWebClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4")
'myWebClient.Headers.Add("Accept-Language", "en-us,en;q=0.5")
Try
myWebClient.UploadStringAsync(downloadUri, "filename=" &POST1)
End If
Catch e As System.Net.WebException
MsgBox("A web exception has occured [" & strURL & "]." & vbCrLf & " System returned: " & e.Message, MsgBoxStyle.Exclamation, "Error!")
Exit Try
Catch e As System.Net.ProtocolViolationException
MsgBox("A protocol violation has occured [" & strURL & "]." & vbCrLf & " System returned: " & e.Message, MsgBoxStyle.Exclamation, "Error!")
Exit Try
Catch e As System.Net.Sockets.SocketException
MsgBox("Socket error [" & strURL & "]." & vbCrLf & " System returned: " & e.Message, MsgBoxStyle.Exclamation, "Error!")
Exit Try
Catch e As System.IO.EndOfStreamException
MsgBox("An IO stream exception has occured. System returned: " & e.Message, MsgBoxStyle.Exclamation, "Error!")
Exit Try
End Try
End Sub
|
|
|
|
|
What? Nobody, Is that impossible???
|
|
|
|
|
It seems to be a tough one! but Hey! pro's pls. get a workaround.
|
|
|
|
|
In the simplest design, you'd wrap a WebClient in a class that does nothing but submit a request, then wait for the response. Create a new instance of this class on a seperate thread, giving it the URL of the file you want to download. Any events for tracking progress would have to be marshalled back to the UI thread.
Do I have any example code? Nope. I suggest searching the articles and Googling around for it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello Everybody,
I created sp for insert in sql server 2000.I need to call the procedure using vb.net 2003.I tried using parameters to supply input to sp but, i got error as "Procedure 'asd' expects parameter '@ID', which is not supplied"
I dont know proper way to do it .
can anybody Guide me
Thanks in Advance.
|
|
|
|
|
put your code here...
you must use command parameters...
|
|
|
|
|
For example, i have a db with name abc.mdb in this db i have a table tha calls "aaa" in this table i have the information "a" "b" "c" "d". Is it possible to save the information of the lines "a" and "b" in a TXT at the same time? Could some one give me an example?
cumps
|
|
|
|
|
No you will have to save to the db then save to a file or vice versa.
Mike Lasseter
|
|
|
|
|
I have created a software in VB.dotnet (Microsoft development enveronment 2002)
After installation i received (KeyCodeV2.dll) Error. As a solution I added (Managed.msm, Database_Access.msm, Database_Access_enu.msm, Regwiz.msm)
Again after creating new setup and installing, now even if I dont receive any ERROR my report is not shown (Loaded).
But same report while running from environment is shown.
|
|
|
|
|
are you trying to view multiple reports? have you set the report source property for the crystal report viewer?
|
|
|
|
|
Hi,
In 1 form i put 3 combobox that the data fillout from 3 tables sql database,
i'm using DataAdapter, Dataset (as usual) to bind the field from table1 to Combobox1, i got no problem with that, but when i want to bind the second table to second combobox and the third table to the third combobox are not succeded, the value in the other combo is the same with the first combo, how do i set it up properly?
Abbas
-- modified at 6:11 Wednesday 12th July, 2006
|
|
|
|
|
When you say "bind the second table to second combobox and the third table to the third combobox"... Are using three different DataAdapters and three different DataSets?
|
|
|
|
|
Yes i did, three adapter, three dataset, three sql command, all of that in one event, form_load event, is it someting to do with the event?
Abbas
|
|
|
|
|
Interesting...
Can you email me the code or post it here and I'll take a look at it?
|
|
|
|
|
I'm sorry, now is ok, i just miss type the objname of each data adapter and dataset, now is ok, but i have another question
I already bind the column from table to combobox, and succesfull, but i need to add an empty row, so when the form run the combobox is empty but when i select it will show the empty row and the fields, the result is like this
'objComboBox1
" " 'empty field
"Field 1" 'come from table
"Field 2" 'come from table
"Field 3" 'come from table
"Field 4" 'come from table
etc
Here are the Code that i use
Dim objConn As New SqlConnection
Dim objDS As New DataSet
Dim objDA As New SqlDataAdapter
Dim objCM As New SqlCommand
objConn.ConnectionString = "<cut>"
Try
objConn.Open()
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try
objCM = New SqlCommand("Select Name_VC from tPersonnel_TB Order by Name_VC", objConn)
objDA.SelectCommand = objCM
objDA.Fill(objDS, "Personnel")
CBPersonnel.DataSource = objDS.Tables("Personnel")
CBPersonnel.DisplayMember = "Name_VC"
Thnx
Abbas
-- modified at 6:33 Thursday 13th July, 2006
|
|
|
|
|
I know there is a way to specify that any items in the combobox should not be removed during binding. I did this in an asp.net app not long ago but I dont have access to the code at the moment...
Basicly you add the empty string to the combo set the (at the moment unknown) property not to clear the combo and then you do the databinding.
Workaround: Do the databinding and then: CBPersonnel.Items.Insert(0,"")
BR
Fredrik
|
|
|
|
|
I just do what you said, if i put after the data binding it show an error but if i put before binding the data the form is running ok but nothing happens the data is still the same
is there anyway else to do that?
Abbas
|
|
|
|
|
Hello All,
Has anyone got any code/pointers that would help me to retreive site/subnet information from Active Directory Sites and Services using VB.NET 2003. Have been searching the net in vain.
Thanks in advance for any replies
Scott
|
|
|
|
|
I am making one application in VB6.
I want to find out that whether the flash plug in for IE is installed in the current machine or not.
Can anyone suggest a way for this?
Regards,
Ketan.
|
|
|
|
|
When I start up my app, I would like the main form to take up the entire screen (maximize). I know in VB6, you could do vbMaximize. How do you do this in VB2k5?
Thanks!!!
|
|
|
|
|
In the forms property viewer set the WindowState property to Maximized or at runtime add Me.WindowState = Maximized
|
|
|
|
|
hi all..
i have a problem in communication software to hardware.. actually, i want to know the basic concept how we send the data to the hardware using serial port.. for example, how can i switch on and off the led when i click the button in my vb projects..
can someone please help me..
areon25
|
|
|
|
|
Then you must know how the hardware reads the data. Meaning you must know the communication protocol. What type of hardware is it?
BR
Fredrik
|
|
|
|
|
thanks for the email..
actually, i just want to switch ON/OFF the LED as i mention before..
areon25
|
|
|
|