|
File/NEw/Web site. You don't need a sln file anymore, you can create a website just by pointing to the directory it's in.
ASP.NET 2.0 is very different from 1.1.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Christian,
Please can you say one thing this different is also on classes and I need to learning a new things
Thanks
|
|
|
|
|
hi,
how to print a form including all its controls.
i have to create a document in VB.Net.i have used ritch texbox and and i placed labels and textboxes in the ritch textbox.all the labels and textbox values are taken from the database.then it looks like a document.
i have to print this document.can anybody help u.
|
|
|
|
|
|
I am trying to hook keyboard events(basically disable printscreen key) from windows service. 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! I have tried almost all combinations to try and execute this code for example: converting class into a dll and then calling it from service code, include the whole code in a different file etc. but all of them do the same thing, i.e compile and install without errors but not work! i am including the code here for your refference. and yes i am working on visual studio 2005.
********************************************************************************************
Public Class Hook_PS
Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Integer, ByVal lpfn As LowLevelKeyboardProcDelegate, ByVal hMod As Integer, ByVal dwThreadId As Integer) As Integer
Declare Function UnhookWindowsHookEx Lib "user32" Alias "UnhookWindowsHookEx" (ByVal hHook As Integer) As Integer
Delegate Function LowLevelKeyboardProcDelegate(ByVal nCode As Integer, ByVal wParam As Integer, ByRef lParam As KBDLLHOOKSTRUCT) As Integer
Declare Function CallNextHookEx Lib "user32" Alias "CallNextHookEx" (ByVal hHook As Integer, ByVal nCode As Integer, ByVal wParam As Integer, ByRef lParam As KBDLLHOOKSTRUCT) As Integer
Structure KBDLLHOOKSTRUCT
Dim vkCode As Integer
Dim scanCode As Integer
Dim flags As Integer
Dim time As Integer
Dim dwExtraInfo As Integer
End Structure
Dim intLLKey As Integer
Private Function LowLevelKeyboardProc(ByVal nCode As Integer, ByVal wParam As Integer, ByRef lParam As KBDLLHOOKSTRUCT) As Integer
Dim blnEat As Boolean = False
Select Case wParam
Case 256, 257, 260, 261
blnEat = lParam.vkCode = 44
End Select
If blnEat = True Then
Return 1
Else
Return CallNextHookEx(0, nCode, wParam, lParam)
End If
End Function
Public Function Hookkbd() As Integer
intLLKey = SetWindowsHookEx(13, AddressOf LowLevelKeyboardProc, Marshal.GetHINSTANCE (System.Reflection.Assembly.GetExecutingAssembly.GetModules()(0)).ToInt32(), 0)
Return intLLKey
End Function
Public Function Unhookkbd(ByVal id As Integer) As Integer
UnhookWindowsHookEx(id)
End Function
End Class
********************************************************************************************
Content of the Service file:
Public Class DisablePS
Dim kbh As New Hook_PS
Dim id As Integer
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
id = kbh.Hookkbd()
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
kbh.Unhookkbd(id)
End Sub
End Class
*******************************************************************************************
Any help on this would be highly apprecited.
Thanks in advance.
|
|
|
|
|
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.
|
|
|
|