|
Your welcome!
And remember to use the message voting options to show your appreciation!
|
|
|
|
|
Question... why not just use the string.replace function to accomplish this? It seems like you are doing a ton of work where simply using replace with a specific pattern could get you what you want simply.
I admit that I have not taken a huge look at this problem thread, but...
|
|
|
|
|
I am using vb.net 2008
I want to take Input in a text box from other defice like
Barcode Scan or Card Swipe.
But I need to Stop Manual input from keyboard on That TextBox.
I Test in my code That in Both Cases "KeyPress Event" Called.
How Can I do that?
Textbox taken Input from Other Device and Not From Keyboard.
Arindam Banerjee
Sr. Software Developer
Rance Computer Pvt Ltd.
Kolkata (India)
|
|
|
|
|
How does the scanner pass in the values to the text box?
If it is via code, then why do you need a text box at all, and use a label to display the scanner input......
|
|
|
|
|
Since most of those devices are keyboard emulators anyway (normally refered to as "keyboard wedge") you cannot disable the keyboard. You would find it extremely difficult to tell the difference between a normal keyboard key and one coming from the scanner.
You normally would not even bother with the textbox but enable the forms KeyPreview property, then handle it's KeyDown event, looking for the prefix string that is prepended to the code coming from the scanner. You ARE using pre- and post-fix codes coming from the scanner, right? If not, you'll find it impossible to tell the difference between what it typed and what is scanned.
All of the characters you see after the prefix string will be whats scanned, until you see the postfix characters. When you see the prefix code, you do NOT pass the keystrokes up the chain to the textbox.
|
|
|
|
|
Hello to All,
Actually i want to Know that how can we build our own Driver using vb.net and C#.
Is is Possible Driver Development by using Vb.net and C#.
Your Help is needed.
Thanks a Lot.
If you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: Is is Possible Driver Development by using Vb.net and C#.
No. Drivers need C/C++.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
...and the Windows Driver Kit[^].
You REALLY do NOT want to do something like that in managed code (VB.NET, C#).
|
|
|
|
|
Hello Everyone,
Finally I am at right place to get some knowledge.
In my office, I use a excel VBA tool(Macro) for opening all hyperlinks in Internet Explorer new Window.
But now we use Internet Explorer 7, which supports Tab browsing.
Could anyone please through light on how can I use OpenInNewTab and Navigate2 to add in existing code, so that when I click on button it can open all hyperlinks in single window and multiple tabs.
Would be very helpful for us to make our life easy.
Thanks
-mprathore
|
|
|
|
|
What code are you using at the moment to fire off a browser session?
|
|
|
|
|
Hi Dave,
Thanks for your reply.
I am using below mentioned code. Technicaly may be its not exact as I dont have that file with me right now..but you will get outline of it...once again thanks..hope you will find solution
Dim ie as Object
Dim i as integer
Dim web_link as string
Set IE = CreateObject("InternetExplorer.Application")
ie.visible = true
web_link = "a weblink with a no. in end"
' Actually integer I is for increment value for next link pasted in excel second row same colomn.
ie.navigate web_link
'then some code here for wait, to let the web page load.
'next IE window will open second hyperlink pasted in second row same colomn
ie.navigate web_link, "value of i(incremented)"
almost like this coding....I am sorry for not being clear about codes.
Thanks
-Mp
|
|
|
|
|
Right, i have managed to do it, but it is browser setting dependent;
I put a bunch off URLs on an excel spreadsheet, and a button pointing to the following code;
Public Sub goNav()
Dim ie as Object
Set IE = CreateObject("InternetExplorer.Application")
ie.visible = true
Dim x as integer
Dim links as Hyperlinks
Set links = ActiveSheet.Hyperlinks
For x = 1 to links.count
ie.navigate links.item(x).address,nothing, "_blank"
next
End Sub
For it to open in new tabs this setting must be set in IE settings;
Internet Options
General Tab
Tabs Settings : Settings
Always open pop-ups in a new tab = Selected
Sorry, Best I can Do!
|
|
|
|
|
How to call Javascript function in ASPX page through VBScript. I am using http stuff to get page from server, now on clicking some button on the page I am getting a popup which is not being requested through any URL. But is being called through javascript. Please see the example below:
xmlhttp.post someurl
xmlhttp.send
writetodisk(xmlhttp.responsetext)
Now in this how should i call that javascript function to handle the popup????
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Ash_VCPP wrote: Javascript ASPX VBScript
Which one of these is Visual Basic?
MVP 2010 - are they mad?
|
|
|
|
|
Trying to build add AJAX[^] manually?
There's no popup in the code that you presented. Can you paste the OnClick-handler of said button?
--edit--
Richard is right, this may not be the most appropriate forum for this. There's a forum specialized in webstuff, and the webgurus reside there.. Sometimes they visit this thread, sometimes they don't.
I are Troll
|
|
|
|
|
Dim listener As New TcpListener(System.Net.IPAddress.Any, 7778)
'start it
listener.Start()
Dim bytes(1024) As Byte
Dim Command As String = Nothing
While True
Console.WriteLine("Waiting for a connection... ")
Dim client As TcpClient = listner.AcceptTcpClient()
Console.WriteLine("Client connected... ")
Console.WriteLine("Please Wait... ")
Dim ns As NetworkStream = client.GetStream()
Command = Nothing
Dim i As Integer
i = ns.Read(bytes, 0, bytes.Length)
While (i <> 0)
Command = System.Text.Encoding.ASCII.GetString(bytes, 0, i)
Console.WriteLine(Command)
i = ns.Read(bytes, 0, bytes.Length) 'stopper
End While
ns.Close()
client.Close()
Console.WriteLine("...")
End While
Can anyone please help me why the execution stops at the bold line. Compiler don't execute anything after this line?
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
When you say stops, do you mean it throws an exception? What is the exception?
have you looked at the networkstream class documentation, you should be testing it canread before trying to read. look at the read method docs.
[modified text]
i just noticied that you have basically copied the example in the MSDN for the TCPListener, i have found in the past that these are not always reliable, and basically just show how everything hooks together, you still then need to look at each of the classes you are using to get more of the specific requirements (like the canread etc.)
modified on Saturday, January 30, 2010 3:34 AM
|
|
|
|
|
Thank you for your reply daveauld. Actually it didn't throw any exception at all just stops the execution and won't continue the loop or the remaining statements after the loop which is kind of weird. Do you have any idea what's wrong with the above code???
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
I would change the read part to match the example in the networkstream.read example in the docs so;
Do
numberOfBytesRead = myNetworkStream.Read(myReadBuffer, 0, myReadBuffer.Length)
Loop While myNetworkStream.DataAvailable
|
|
|
|
|
Hi,
Stream.Read() is a blocking call. Read the documentation, it contains:
"read; however, if an exception occurs, the current position within the stream remains unchanged. Implementations return the number of bytes read. The return value is zero only if the position is currently at the end of the stream. The implementation will block until at least one byte of data can be read, in the event that no data is available. Read returns 0 only when there is no more data in the stream and no more is expected (such as a closed socket or end of file)."
So your program is waiting inside the Read() method for more data to become available. You may have to restructure your communication, maybe use asyncrhonous calls, another thread, a time-out, it all depends on the circumstances.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
It stops because .Read is a blocking call and won't return until it has actually read something. Since there's nothing more to read, the .Read call will sit there until there is something.
|
|
|
|
|
Thanks for your answers guys now i got the reason for this kind of behavior.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
Hi All.
I'm new to vb and hope you can help me. I want to create a pc audit database program.
I've got two forms:
Form1 displays in a gridview with three tables and
Form2 displays in details view with all the data.
I want the user to select a row in the gridview and click a button that will open form2 and display all the info of that pc.
Any help will be appreciated.
Thank you.
|
|
|
|
|
In Your project you need to create a class for PC. In form2 you need to create a property (i.e. CurrentPC) that returns a PC object. In the constructor for form2 you need to include a parameter that accepts a PC object. When the user clicks on the datagridview you can create a new form2 passing on the specific PC object. Good luck
|
|
|
|
|
Thanx for your help but I've got no idea what that means.
Like I said, I'm new to VB. Could you explain that please.
Thank you.
|
|
|
|