|
kushang.moorthy wrote: This code works perfectly fine when i put it in a form but when i try it from windows service it compiles properly, installs also without any error but does not disable the required key!
Of course not! Windows Services run under a seperate (not visible) desktop. Only one desktop can receive the input focus at a time, so according your service code, you never get any keystrokes.
Try going to the Services manager, finding your service, then enabling the option to "Allow service to interact with desktop". This might take care of the problem.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all,
I wrote some vbscript code to find place holders in Excel cells (e.g. yadayada<<comments>>blahblah) and replace them with some user defined text. I tried Cells.Replace method but it only works if the string is less than 255 chars... I searched the MSDN try to find a work around but no banana... Any help will be highly appreciated
Henry
|
|
|
|
|
Hi guys, I'm new to programming and the first language I'm trying to learn is VB .NET.
It's going pretty well for me, but I have a question and I was wondering if anyone here might be able to help me.
I have a text box set up to get information from the user, once that is computed an anwser anywhere from 0 minutes to 180000 minutes. I was wondering if there is a tutorial, or a few lines of code that would be able to change the raw data of 180,000 minutes to days/hours/minutes in three different text boxes.
For example, if the user entered a number which got them 129,564 minutes that would display as 89 days 23 hours and 24 minutes.
Thanks a lot, aqzman
EDIT:
I thought this code might work, but it never. Haha.
If Time > 1440 Then
Time = (Time / 60)
Time = (Time / 24)
txtDisplay.Text = Time
End If
If Time < 1440 Then
Time = (Time / 60)
txtDisplayHour.Text = Time
End If
If Time < 60 Then
Time = (Time)
txtDisplayMin.Text = Time
End If
-- modified at 19:50 Monday 2nd October, 2006
|
|
|
|
|
You're on the right track. You need to use the Mod operator ( it's % in C#, I suspect it's Mod in the ever literal VB ). This will return to you the remainder of your division. So, if you have 63 minutes in Time, Time Mod 60 would give you 3, the number of seconds.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a label control and I want to modify its text from within a thread (example shown below), but I get a runtime access exception. How do I access controls from a thread?
Imports System.Threading
Imports System.Threading.Thread
Public Class Form1
Public thrd As New Thread(AddressOf MyThread)
Public counter As Integer = 0
Public Sub MyThread()
Do
counter = counter + 1
lblThreadCount.Text = "Thread Count = " & counter
Sleep(100)
Loop While 1
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblThreadCount.Text = "Thread Count = " & counter
thrd.Start()
End Sub
Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
thrd.Abort()
End Sub
End Class
|
|
|
|
|
Add the following line to the top of the Form1_Load event:
Control.CheckForIllegalCrossThreadCalls = False
|
|
|
|
|
how to get how many capacity the hard disk have? for example 80 GB!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Assuming the .NET Framework 2.0, you're looking for the DriveInfo[^] class and it's TotalSize property.
In using .NET 1.x, you can get it using the WMI Win32_LogicalDisk class and the System.Management namespace.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I need to parse a string that contain the following formats:
xxxxxxxxx + <space> + nn + nn //ignore the rest
xxxxxx //a series of strings
Having gone through the .split method it seems to be suitable for this type of task, but what algorithm(s) would you suggest for implementing it?
Jon
|
|
|
|
|
If your goal is something more complex than 'break each bunch of characters that doesn't contain a space into a string', you probably want to use regular expressions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi!
I would like to know if anybody has a source where you can send data through an already established connection by hooking into it?
Greetings .. Mik
|
|
|
|
|
You can't do that by "hooking into" the existing socket. There's no way to get at the socket once it's been created by another app.
You can, however, write a proxy server, where your application can connect to your server, then your server forwards the requests on to the real game server. Then you've got a "man in the middle" way of looking at all the traffic and injecting your own.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The other solution I can think of is an NDIS driver (similar to the way software based firewalls hook into network traffic). But they are fiddly to write as you get the packets at a really base level fresh off the network before anything has had a chance to process them.
|
|
|
|
|
Yeah, I didn't even want to go there for this.
10 bucks Aussie says this question is for some kind of game overlay!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The other solution to Dave's suggestion that I can think of is an NDIS driver (similar to the way software based firewalls hook into network traffic). But they are fiddly to write as you get the packets at a really base level fresh off the network before anything has had a chance to process them. Also, you can't write one in VB or VB.NET. I wrote one some years ago in C.
|
|
|
|
|
Hello,
Using VB.NET, I have populated a dataset that reads records from table tblCustomer that resides on the network (SQL Server 7.0). How do I take the records from that dataset(SQLDataset), and store it in a local table called tblCustomer(SQL Express Edition)?
Keeping in mind, my tables, tblCustomer, has about 52 columns, so if I can some how just import the data in one shot as opposed to using the .NewRow methods...
myNetworkSqlDataAdapter.Fill(SQLDataset)
Thanks in advance.
|
|
|
|
|
how to check were the program files are on?? C:/ or D:? how to check it please??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
ADY007 wrote: how to check were the program files are on?? C:/ or D:? how to check it please??
The program files need not be on the primary drive, and the name of the folder will be localised for the language version of Windows.
You need to read the following documentation:
* Environment.GetFolderPath()[^] - This has a code sample you might find useful
* Environment.SpecialFolder[^] - This has details of all the other folders to which you can find the location.
|
|
|
|
|
how to unzip a zipped file using the vb.net?
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
This[^] might work with a bit of teasing.
|
|
|
|
|
thanks alot my friend
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
|
how do i retrieve data from sql and cut it to 20 characters to display it in a text box. The data in about 100 chatacters in the database but i only need 20.
Please help
|
|
|
|
|
Off the top of my head I'd say pull the data in as normal & perform editing on it using string methods.
Are you looking for a particular bit of string in the data you're pulling through? How do you know which 20 characters it is? The first 20? A bit more explanation please.
|
|
|
|
|
I am looking for the first 20 characters. from character 1 to 20.
Hope this is clear.
|
|
|
|