|
Dave Kreskowiak wrote: You better don your asbestos suit for posting this in the programming forums, where, if you bothered to read the Posting Guidlines, posts like this are expressly forbidden.
Where did the original post go? I wanted to flame it
|
|
|
|
|
It was a recruiter from TEKsystems, posting a job opening in Illinois. You know, the exact same email he blindly sends to hundreds of people, praising their resume, without having even seen it!
|
|
|
|
|
Dave Kreskowiak wrote: It was a recruiter from TEKsystems, posting a job opening in Illinois.
Oh, that guy. I just barked at him for cross-posting and actually did a friendly suggestion of the CP job board :->
|
|
|
|
|
Hi,
I am new in programming, I involved in development new project related to point of sales using Visual Basic.Net , i need some tips about how to make bar code reader (or Manually) can read the code on the items, and put it in datagrid of the project.
.... Please some help
thanks
new member
|
|
|
|
|
Mr. Wonderful wrote: I am new in programming
You're in WAY over your head already. This is a very complicated project for someone who has little experience in programming, let alone using specialized hardware like this.
The barcode reader simply reads the code from the item and sends that number t your code. How you get it depends entirely on the barcode reader you're using. Some send the data over a serial port, others over TCP/IP, and still others through the keyboard, just like the user typed the code.
You put the data into a database, not a DataGrid. There's tons of examples all over the web, you simply have to Google for something like "insert data into Access database VB.NET", or whatever database engine you're using.
|
|
|
|
|
Mr Dave,
Although I expect your replying, I didn't mean explain all about how to filter data into datagrid, but I mean to how to begin. I know I'm not a professoinal developer to develop like this project, but just all I want is guid me how to begin, and you did it, thanks again.
regards
|
|
|
|
|
hello,
how can i see for how much % the processor (CPU) is being used? (just like in the task manager) Thanks in advance,
--Zaega--
|
|
|
|
|
I found this example awhile ago, and it's still the only way that I've found to read CPU usage that actually works.
Dim eIdle As Int64
Dim eKernel As Int64
Dim eUser As Int64
Dim sIdle As Int64
Dim sKernel As Int64
Dim sUser As Int64
Dim cIdle As Int64
Dim cKernel As Int64
Dim cUser As Int64
Dim systemTime As Int32
Dim totalCpuUsage As Single 'Long 'Int64
Public Declare Auto Function GetSystemTimes Lib "kernel32.dll" (ByRef idleTime As Int64, ByRef kernelTime As Int64, ByRef userTime As Int64) As Boolean
Dim updateSpeed As Integer = 500
Public Sub GetCPUUsage()
'Retrieve the Times values before starting the delay.
GetSystemTimes(sIdle, sKernel, sUser)
'The delay for how often to check and update the cpu usage values.
Threading.Thread.Sleep(updateSpeed)
'Retrieve the Times values after the Delay.
GetSystemTimes(eIdle, eKernel, eUser)
'Get the values calculated between the starting and ending Times values.
cIdle = (eIdle - sIdle)
cKernel = (eKernel - sKernel)
cUser = (eUser - sUser)
'Calculate the total system time. Which is Kernel and User time together.
systemTime = (cKernel + cUser)
'Simply check if the rounded option is true or not and display the usage value.
totalCpuUsage = (systemTime - cIdle) * (100) \ (systemTime)
'System.Windows.Forms.Application.DoEvents()
CPUUseLbl.Text = "CPU Usage: " & totalCpuUsage.ToString & "%"
Dim Ok As Integer = 0
End Sub
Hope this helps.
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
That's a ton of work for something that's supplied by the PerformanceCounter class already...
[EDIT] Helps if I put the correct class name in...
-- modified at 14:45 Monday 14th May, 2007
|
|
|
|
|
Dave Kreskowiak wrote: That's a ton of work for something that's supplied by the PerformanceCounter class already...
My exact thoughts
|
|
|
|
|
Thanks all
|
|
|
|
|
The CPU percentage has a couple of parts, user time and kernel time. They are calculated when the measurement it taken, not accumulated over the life of a process.
You can get the current percentages using the PerformanceCounter class. Look up "performancecounter components" in MSDN and you'll find a bunch of examples.
|
|
|
|
|
Hello
VS 2005,
I am developing MDI application. The user would like to have an timer running in the back ground that will send e-mail every 5 times.
Sending the e-mails is not the problem, but how can I control the timer in the back ground.
On one of the mdi forms the user will select send e-mails (start timer) and on this same form the user can stop sending e-mails (stop timer).
Would a timer control in the main form be ok? If so, then the mdi form that controls the start and stop should be able to communicate this to the main form. If the form that starts and stops the timer is closed the timer should still run. The timer should run until the application is completely closed by the user.
Any suggestions or code examples would be most grateful,
Thanks,
Steve
|
|
|
|
|
You can do it in two ways.
1. Have a hidden form that has this timer and which can be controlled by other forms (ungainly approach)
2. Create an instance of System.Timers.Timer in your MDI Form, add an event delegate to the Elapsed event of the Timer object you created and have your email logic put in a separate class file, which can be called from the Elapsed event.
The Timer you see in the toolbox is the Windows.Forms.Timer object, apart from this, you can also use System.Timers.Timer and System.Threading.Timer.
Regards,
SG
|
|
|
|
|
Hello,
Thanks for your reply.
The 2 option sounds like the best. Can this be extended for many timers. As the user will want to be able to create many timers for many jobs. for example, if they have 5 jobs open, it should send 5 e-mails every 5 minutes.
Many thanks,
Steve
|
|
|
|
|
You shouldn't be setting up Timers all over the place. Your code should be written to fire a single Timer every minute, then in the event, check the current system time against the scheduled execution times of various items.
There is a limit to the number of Timers a single process can run. I think it's 32, but I seem to remember something about the type of timer being used too.
|
|
|
|
|
Hi All,
Please help me for packet drop/pass using VB6.
I have found winpcap and vbpcap for capturing packet but vbpcap is still not support packet drop/pass. Please help me for packet drop/pass.
|
|
|
|
|
You can't do this in VB6. This requires writing a device driver for the network stack to support passing or dropping packets.
|
|
|
|
|
I have a class inherited from Control Class
Public Class MyClass
Inherits System.Windows.Forms.Control
End Class
Now when i am creating object of MyClass, I am getting so many events, properties and methods of Control class. Out of all the events, properties and methods, i want to completely hide few of them.
Is there any way to do that?
|
|
|
|
|
you can't hide any of the properties. however you can put a class infront of your class that only exposes what you want
Public Class mytest
Private mB As B
Public Property Text() As String
Get
Return mB.Text
End Get
Set(ByVal value As String)
mB.Text = value
End Set
End Property
Public Sub New()
mB = New B
End Sub
Protected Class B
Inherits System.Windows.Forms.Control
End Class
End Class
|
|
|
|
|
Thanks for your answer. This is a good way around. but by this way, i cannot add object of mytest as a Control in my form.
|
|
|
|
|
Hi all,
I have a variable(String) that i want to store it in resources file so that i can retrieve it's value in coding process. But unfortunately, in coding process, i need to change it's value.
Ex : I have a variable MyName that is stored in resources
+ begin : MyName = "FirstForm"
+ after changing : MyName = "SecondForm"
How could i change MyName's value from "FirstForm" to "SecondForm" ?
|
|
|
|
|
Resources are Read Only. You'll have to save this information somewhere else.
|
|
|
|
|
Hallo,
I wrote this code, it works and it magnify "MyPicture" 8 times to the Form1.
Now my question:
Is there a possibility to use the bitmap of a PictureBox for the Destination of
StretchBlt, or copy the destination to a PictureBox?
Thanks for answerig, Hans-Christian
Imports System.Runtime.InteropServices<br />
<br />
Public Class Form1<br />
Dim srcImage As New Bitmap("MyPicture.bmp", True)<br />
Dim Graph As Graphics = Me.CreateGraphics<br />
Dim desHdc As IntPtr = Graph.GetHdc()<br />
<br />
Dim srcHdc As IntPtr = CreateCompatibleDC(IntPtr.Zero)<br />
Dim hBitmapSrc As IntPtr = srcImage.GetHbitmap()<br />
<br />
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick<br />
<br />
SelectObject(srcHdc, hBitmapSrc)<br />
SetStretchBltMode(desHdc, 13369376)<br />
StretchBlt(desHdc, 0, 0, 4096, 4096, _<br />
srcHdc, 0, 0, 512, 512, _<br />
TernaryRasterOperations.SRCCOPY)<br />
<br />
End Sub
|
|
|
|
|
Beginner_HC wrote: Public Class Form1
Dim srcImage As New Bitmap("MyPicture.bmp", True)
Dim Graph As Graphics = Me.CreateGraphics
Dim desHdc As IntPtr = Graph.GetHdc()
Dim srcHdc As IntPtr = CreateCompatibleDC(IntPtr.Zero)
Dim hBitmapSrc As IntPtr = srcImage.GetHbitmap()
This is a REALLY bad idea. Make this stuff class-scoped will cause you severe problems later on. You should ALWAYS Create, Use, then Destroy your graphics object only when you need them and only for as long as you need them. Caching one like this doesn't do you any good because some operations will only be commited when the Graphics object is finally destroyed.
What are you trying to do with this code again? You OP wasn't very clear about what your doing with this. What's the ultimate goal here?
|
|
|
|