|
You need the System.IO.Ports namespace. It is in .NET 2.0.
Here is an article (in C#) on The Code Project[^] that should get you started.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Is it possible with VB to automatically identify what the links are on a page? and is it possible for VB to then save the targets? Many Thanks
|
|
|
|
|
how to update the localdatabase and central database by using windows service every 10 minutes
|
|
|
|
|
how to update the localdatabase and central database by using windows service
|
|
|
|
|
Hi all,
i'm having problem on how to retrieve the value of each item in combobox.
I haven't select the item, but i just want to read each item in the combobox.
here is how my codes loook like:
dim drv as string
For i = 0 To Me.cboDrives.Items.Count - 1
drv = cboDrives.Items.Item(i)
If drv = "(C:\)" Then
PercentFree(drv, percFree)
GetFreeSpace(drv, freespace)
If percFree <= 15 Then
messagebox(...)
End If
End If
next i
When i run the codes, the error keep saying "Cast from type 'NameValue' to type 'String' is not valid."
Is there something wrong with my coding???
Thanks a lot in advance.
besah
|
|
|
|
|
Since this code is most probably retyped by you rather than a cut and paste, we can't really tell what if anything you have done wrong. Please copy the exact code.
Also, the error you received should have told you on which line it occurred. Telling us that will also help us diagnose your problem. Have you run the code in debug mode to attempt to diagnose the problem yourself?
Note that we should not have to read your entire code to do this - help us to help you.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
I would experiment with breakpoints. The cast is obviously implicit because I don't see where you are performing an explicit cast.
I copied your loop
<br />
dim drv as string<br />
dim i as integer<br />
For i = 0 To Me.cboDrives.Items.Count - 1<br />
drv = cboDrives.Items.Item(i)<br />
next i
and I didn't get any exceptions, so the error is probably occuring in either PercentFree or GetFreeSpace
/jason
|
|
|
|
|
I am populating a datagrid from a CSV file. This file does not have a header column I would like to add the datagrid header in code at runtime and pull the data from the csv file.
At present the first line in the csv file becomes the datagrid header how do I stop this and add the hearder at run time...
Thanks
<br />
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then<br />
Dim fi As New FileInfo(OpenFileDialog1.FileName)<br />
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Text;Data Source=" & fi.DirectoryName<br />
Dim objConn As New OleDbConnection(sConnectionString)<br />
objConn.Open()<br />
Dim objCmdSelect As New OleDbCommand("SELECT * FROM " & fi.Name, objConn)<br />
Dim objAdapter1 As New OleDbDataAdapter<br />
objAdapter1.SelectCommand = objCmdSelect<br />
Dim objDataset1 As New DataSet<br />
objAdapter1.Fill(objDataset1, "Import")<br />
DataGrid1.DataSource = objDataset1.Tables(0).DefaultView<br />
objConn.Close()<br />
End If<br />
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
I'm trying to use a HttpWebRequest to login to a Breeze server. I've tried a WebClient also. I keep getting a '400 bad request' reponse from the server.
This URL works fine through a browser:
http://admin.breezecentral.com/api/xml?action=login&login=jon@doe.com&password=foobar
Its a test server so go ahead. Play with it.
Here is my code:
Dim encoding As New System.Text.UTF8Encoding
Dim PostData As String = "action=login&login=jon@doe.com&password=foobar"
Dim Data() As Byte = encoding.GetBytes(PostData)
Dim LoginReq As Net.HttpWebRequest = Net.WebRequest.Create("http://admin.breezecentral.com/api/xml")
Dim CookieC As New Net.CookieContainer
With LoginReq
.KeepAlive = False
.Method = "POST"
.ContentType = "application/x-www-form-urlencoded"
.ContentLength = Data.Length
.CookieContainer = CookieC
End With
Dim SendReq As IO.Stream = LoginReq.GetRequestStream
SendReq.Write(Data, 0, Data.Length)
SendReq.Close()
Dim LoginRes As Net.HttpWebResponse = LoginReq.GetResponse()
CookieC.Add(LoginRes.Cookies)
Dim sReader As IO.StreamReader = New IO.StreamReader(LoginRes.GetResponseStream)
Dim HTML As String = sReader.ReadToEnd
Debug.Write(HTML)
Please help. I'm sure I have some small setting wrong.
|
|
|
|
|
I found the problem. I was using a proxy server and had the port wrong. I didn't realize the error was coming from the proxy server. Otherwise my code was fine.
|
|
|
|
|
Hi i had start one project audio format convert but i do not how to play songs in vb.net plz tell me and give the namespace, and one more doubt is what is jagged array?????????????????
Kiran Kumar
|
|
|
|
|
if you want to import System sounds like Asterisk,Beep,Hand and others you should import the namespace System.Media but if you want to add a project that plays any kind of sound formats you can use a DirectX component called Quartz.dll which is part of Windows MediaPlayer and Windows Operating system.This file you can find in this path: C:\WINDOWS\system32.Open the Visual Studio Command Line and type the following command:[WindowsDir]/tlbimp quartz.dll /out:QuartzTypeLib.dll.The [WindowsDir] is where your instalation of operating system is(in most cases C:\).I hope I helped you cause I had the same problem and should digging a lot to find a way to play sound formats.Best wishes!
Qendro
|
|
|
|
|
hi friends.
how i make deploymenet to project wrote by vb.net 2003, but this project has file rpt(crystal report)
123
|
|
|
|
|
Hye I made a User Control In VB.Net but i ' m facing one problem
Evrythng is runing nicely but when i trap any event of my control then my control can't trap any event.
I made a datagrid control I just need to pass a dataset , automatically my control shows all record now i want to write some code on click of that control but its not effective .
e.i.
I ve written my code on click event of my control then my control can't trap that event wht can i do ? can u giv me any solution of this problm .
prashant
|
|
|
|
|
Say you have a data grid that is filled from information pulled from a database. Now say you have 50 records that are put into the data grid, and you basically have a data grid with 50 records in one big column.
I want to know how to make it say 2 columns of 25, so it looks a bit better than just one big hug column that streches away off the bottom of the page.
|
|
|
|
|
i wondering how do i refresh the access databse in my form after i add or delete data ??cause i have to exit the system then rerun the system then it will show the newest information...
|
|
|
|
|
try the requery method. Put it in the afterupdate event of your form. then you use requery method on the recordsource of your form.....try that
|
|
|
|
|
|
Hi,
How to find a Excel.exe file path in drives
Any comments,suggestions are welcome
thanks in advance
Kalaiselvi
|
|
|
|
|
Kalaiselvi,
I'm not sure what you mean but I'll take a stab at it. If you are using you "search" feature I think that you could just use a wild card. Search for: *.exe should show all exe files. Search for: */excel.exe should show all excel.exe files.
Hope this helps, Garner
|
|
|
|
|
hi all there
i'm novice in vb.net.
please could anybody me the exact steps or code to connect vb.net with
mysql.
please its very neccsary without it my project is stuck.
byeee
Aavesh
|
|
|
|
|
I Hav a problem of accessing the file on other machine ,suppose if i m making a program on machine 17& now i hav access that prog on other machine,so wat will be the procedure to call the content of that file,How to passthe path of that file in the program.tell me the code in vb.net
hope anyone will help me
thanx
Think Positive
Ashu Gupta
codeproject.com
|
|
|
|
|
what do you use database?(Sql server or MSAccess)
123
|
|
|
|
|
I m using sql server
Think Positive
Ashu Gupta
codeproject.com
|
|
|
|
|
Hey,
anybody knows how to generate crystal report from multiple tables having different recordcounts? I tried but wat happens is that if anyone of the table reaches EOF then it gives an error message "Either EOF or BOF is true."
Anybody knows the code to tackle this p/b.
Help me out plz, its urgent.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
-- modified at 5:13 Monday 10th April, 2006
|
|
|
|