|
Buy a book and read it. Try learning some basics and showing some initiative before posting here expecting people to answer the most basic of questions.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello,
I am trying to write a program for my Pocket PC 2003 edition, which can receive and / or transmit IR data.
I know that depending on the device, I will need to know some very specific information to properly send the data that I will want to send. However, for the time being, I would be happy just knowing how to send any old bytes of data that I choose.
The problem mainly lies in the fact that I don't know Socket programming, I guess. So far all I have is:
Dim IR As Socket = New Socket(AddressFamily.Irda, SocketType.Stream, ProtocolType.Unspecified)
Where do I go from here, if I wanted to use the Socket I declared (IR) to send or receive data through my Pocket PC's IR port?
As I sit here, I contemplate the last words of Socrates: "I drank what?".
Pokémon Pearl Friend Code: 4554-2418-6836
|
|
|
|
|
Mind you, I have no IR or mobile development experience...
How you do this depends on how the IR device is exposed to you. You'll either be using Sockets or you might have to switch to using serial communications (COM1, COM2, ...) to talk to the other machine.
You might gleen some information on how to do this from this article[^].
|
|
|
|
|
I have been trying to use socket communications so far, but whether I use that or serial communications, I'm having trouble just setting the connection up in the first place. I've actually been trying to understand how to use either in a desktop setting as well, to no avail.
For the socket communication option, I am having problems defining the EndPoint for the Socket.Connect method. This is what I have so far:
Dim IR As Socket = New Socket(AddressFamily.Irda, SocketType.Stream, ProtocolType.Unspecified)
Dim EP As System.Net.EndPoint
Dim SA As System.Net.SocketAddress
SA = New System.Net.SocketAddress(AddressFamily.Irda, 1)
EP.Create(SA)
IR.Connect(EP)
IR.Send(New Byte() {1})
IR.Close()
This doesn't work because the EndPoint (EP) has not been assigned a value. EndPoint also does not use a New constructor, so I guess I'm just not sure how to declare it.
I would just use the IRDA namespace, but my project is (like so many others') meant to communicate with remote controls and other "dumb" IR devices, rather than communicating with another Pocket PC or Windows based device.
I realize the complications involved in communicating with such a device, but right now my main concern is even being able to send or receive any data at all. I figure I'll sort out the data format after that.
Anyway, I don't know C++, but I will check out that link and see if I understand it.
As I sit here, I contemplate the last words of Socrates: "I drank what?".
Pokémon Pearl Friend Code: 4554-2418-6836
|
|
|
|
|
Hello All,
trying to get all the:
IP address
Network card description
MAC address
operational status
speed
for every network card:
For Each nic As System.Net.NetworkInformation.NetworkInterface In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
TextBox1.Text = (String.Format("{0}", nic.Description))
Label6.Text = (String.Format("{0}", nic.GetPhysicalAddress))
Label10.Text = (String.Format("{0}", nic.OperationalStatus))
Label12.Text = (String.Format("{0}", nic.Speed))
Next
I currently have the above, but it only returns the last network card configuration. If i put exit for before next, it returns the first network card result but I would like to scroll through each card?
Any help would be greatly appreciated.
Thanks
Paul
|
|
|
|
|
Its because you always put the data in the same place i.e. each loop puts the data into the same textbox, so the loop is running OK, its just what you are doing with the data.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Yes that makes sense. I have just tried a messagebox which works OK as it bring a new messagebox for every item. Is there anyway I can pause the loop, and proceed at the click of a button onto the next loop?
Thanks
|
|
|
|
|
You could just add the information to a ListView using columns. But if you really need to do something like that, then try something like this:
NumericUpDown control containing number of items in the collection
When ValueChanged event fires, get item with index NumericUpDown.Value
Use the members of the item to fill in the controls
It's not perfect (IndexOutOfRangeExceptions unless you fiddle around with the NumericUpDown.Maximum property), but it should get the job done
|
|
|
|
|
Hello,
I can't seem to get the numericupdown to work?
How can I put each loop in a separate columned listview?
ta
|
|
|
|
|
Hi,
I suggest you go to the bookstore, have a look at a few VB.NET tutorial books, pick the one you like most and work your way through it. In one weeks time you will learn much more than you would by asking hundreds of questions here. Get the basics first, then start experimenting, while asking informed questions.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
You're basically trying to pause a loop, which, as you've found out, doesn't work very well. The solution is to use an appropriate layout of controls (something that would give you a tabular layout), or to not use a loop at all, but just should the selected card information accessing the data stored in an array fashion, and retrieved by index.
|
|
|
|
|
hi everybody..
i m having an ADD button in my project which function as adding values from database nw i want to change
its caption so that i can use it as a DELETE button for the functionality of deleting frm database
this has to be done on same button...i m having the functionality clear in my project jst need to knw how to use it on same button
plz help
thank u...
|
|
|
|
|
Well, the easy way to do it would be to have two different buttons, one on top of the other. When your application starts, hide the Delete button, by setting it's Visible property to False. When you have to change the functionality, set the Add button's Visible property to False and the Delete button's Visible property to True.
|
|
|
|
|
well thank u
Mr.Dave Kreskowiak
But i want to use it on the same button whn form is loaded at that time it should wrk in add mode and after i double click on listview items it goes in edit mode at that time the same add button should be visible as an delete button...thats the problem i m facing i need that it shld wrk on same buton...both add and delete no other button for delete has to be kept.....
so plz help..
thank u ...
|
|
|
|
|
nazimghori wrote: well thank uyou
Mr.Dave Kreskowiak
But i want to use it on the same button whnwhen form is loaded at that time it should wrkwork in add mode and after i double click on listview items it goes in edit mode at that time the same add button should be visible as an delete button...thats the problem i m facing i need that it shld wrkshould work !!! on same buton...both add and delete no other button for delete has to be kept.....
so plzplease help..
thank uyou ... Smile
try to use whole words, not sms-style!
simply change the button's text to "add" or "delete" in runtime - in your button-click-event check whether the text says "add" or "delete" and execute the appropriate code. Simple.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
thank you very much
|
|
|
|
|
His requirement is superficial and leads to a problem. The solution is a bad one in a production application. Localized apps will not have the same text in the button.Text property as in the inevitble code he will write.
Accepted solutions are to either
1. visually swap out the button with another, prewired button, or, less likely,
2. change the properties of the button, then rewire the Click event handler.
I go for the simpler solution.
Checking for the text as a "switch" does approximately the same thing as option number 2, but relies unreleliable information to do it.
The inevitable code he will write will consist of putting all the "work" code in the button handler (bad practice!) and throwing in an if statement to branch between two sections of code that really should be in their own methods.
|
|
|
|
|
hello every one
I m using sqlserver 2005 as an backend tool and vb.net as front end in my project now when i fire n update query
using datareader and cmd.execute nonquery method.
eg:-
obj.strexecutesql("update regi_mast set regi_numb='" + Me.txt3.Text + "'where regi_numb=" + strid)
obj.lfill(Me.lst1, "select * from regi_mast")
this strid is one label in form which is havng value of listview subitem number..
nw in catch block is having exception like:-
Conversion from string "update regi_mast set regi_numb='" to type 'Double' is not valid.
also i m a beginner..
so plz help me...
thank u...
|
|
|
|
|
nazimghori wrote: strexecutesql
nazimghori wrote: lfill
These are not .NET methods. Did you create these yourself?
nazimghori wrote: ("update regi_mast set regi_numb='" + Me.txt3.Text + "'where regi_numb=" + strid)
This is vulnerable to a SQL Injection Attack. Please use parameterised queries and read Tips on How to Prevent SQL Injection Attacks[^]
The reason for the issue is that you are enclosing the value for regi_numb in quotes making it a string. You should use parameterised queries to ensure that the correct data types are used.
|
|
|
|
|
thank u
lfill and strexecutesql they are the mehtod declared in a seperate class file and through that an object is passed in form for its use....
thanks again
|
|
|
|
|
How can I read jpeg's metadata in IPTC format?
Pouya
|
|
|
|
|
|
If Not (e.KeyChar >= "0" And e.KeyChar < "9" Or e.KeyChar = vbBack) Then
e.Handled = True
modified on Sunday, March 8, 2009 12:49 AM
|
|
|
|
|
WTF
|
|
|
|
|
"An unhandled exception occurred and the all reply to your post should be terminated."
Have some
|
|
|
|