|
optimize garbage collection
|
|
|
|
|
You're actually hurting it, not optimizing it.
The Dispose method does NOT determine when the GC collects an object and frees memory. All Dispose does is give your object a chance to release resources that the GC cannot do itself, such as releaseing unmanaged handles to GDI objects, unmanaged memory allocations, ... Dispose does NOT in any way determine when an object is collected and its memory returned to the managed heap.
Again, why are you doing this? What makes you think you need to "optimize" garbage collection?
|
|
|
|
|
hello all
how can i check that sqlserver is install in server or not??? i create a setup file that install msde. and i want if sql is installed in system msde not install...
can you help me please?M.Alizadeh
modified on Tuesday, February 23, 2010 3:06 AM
|
|
|
|
|
Check if SQL Server exists in the computer services.
|
|
|
|
|
MSDE!? not SQL Server Express?
For MSDE have a look at SQLDMO.DLL. If you are using Express then look at the SMO library, which is the .NET replacement for SQLDMOSteve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
I'd like to start learning programming, which language should I start with for a beginner like me?
neothematrix
|
|
|
|
|
I doubt this was the right place to post this question - but I would say Visual Basic or C# would be the easiest to learn. Java would also be good to learn as it is multi-platform. If you want to fully understand computing languages though, learn C++ (or C). Its a more difficult language, but much more powerful, and if you can understand that language, other languages like VB and Java will make more sense. I started off learning VB6 and while I learned that quickly, when I started trying to learn C I was really confused!
|
|
|
|
|
Thank you. What do you think about Visual Basic Express Edition vs Visual Basic 6.0?
|
|
|
|
|
don't do VB6, it is ancient and obsolete. Choose:
- C# or Java for high-end applications (GUI apps, console apps, server apps, ...);
- C or C++ for low-level and system-oriented stuff (e.g. Windows drivers);
- whatever is required, if you choose a specific platform (e.g. Objective C for iPhone);
- VB.NET if you must.
If a Windows PC is your first environment, I strongly suggest you start with C# (the basic stuff, i.e. up to C# 2.0; no need to go 3.0). And yes, all Visual Studio Express Editions are fine for starters.
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. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Very good. I thank you very much for the suggestions, let me get started. I'll keep posting.
neothematrix
|
|
|
|
|
C# is definitely a good one to learn on if you are working on a Windows PC. You can download Visual C# 2008 Expression edition from Microsoft's web site.
|
|
|
|
|
Hello,
(This applies to C# as well)
I am building a tool using .Net remoting. If I obtain a proxy by Activator.GetObject and then want to switch that proxy by calling Activator.GetObject again with a different parameter - and I do this on a separate thread than the thread(s) that is/are using that proxy, could I run in to trouble? Right now I am using a SyncLock, but there could be several threads using this object, so each one has to wait its turn - even though the server code can handle several asynchronous calls just fine. Could I remove the SyncLocks with no worries?
If you need a little more explanation:
There will be several servers in different locations running the server code via a Windows service. These services may go down, start up, stop working, etc., so my client code may need to switch where it gets the proxy from. I have a separate thread that monitors these servers and tries to maintain the best connection. I want to know if there is a problem if a thread starts using the proxy, and then the connection thread switches the proxy. I assumed there was a problem so I used SyncLocks, which is also causing problems, so if possible, I want to remove the SyncLocks.
Thanks,
Kevin
|
|
|
|
|
Hi all.
I want to make my pen drive password protected so that each time when I insert my pendrive it will ask for a password to access pen drive.
Suggest me how to do this.
Thanks.
Gagan
|
|
|
|
|
You cannot do it in VB.NET or managed code. This requires writing an extension to NTFS.
You're not actually password protecting the contents of the drive. The "drive" will be an encrypted file that is NOT protected on the normal drive. The contents of the file will be what your extension exposes as part of the file system. All I/O has to go through your extension to be encrypted/decrypted in and out of your file. Basically, your making an encrypted .ZIP file and exposing it through an NTFS extension.
|
|
|
|
|
I've been experimenting with TrueCrypt[^]and looks good to me, so far. Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi all.
I am trying to format my pen drive by creating a process of command prompt and using "format" command (without quotes) in vb.net.
The code I am using is below :
Try
Dim pr As New Process
With pr.StartInfo
.FileName = "cmd.exe"
.RedirectStandardInput = True
.RedirectStandardOutput = True
.UseShellExecute = False
.WindowStyle = ProcessWindowStyle.Normal
End With
pr.Start()
pr.StandardInput.WriteLine("format G:" & Convert.ToCha(13)) 'enter to take the pen drive.
pr.StandardInput.WriteLine("{ENTER}") 'next enter to start the formatting process.
catch ex as exception
msgbox(ex.message)
end try
Here my pen drive's drive is G: drive which I want to format.
This code starts the formatting process but it is not formatting the pen drive and also the command prompt window remain open always.
Suggest me what should I do to format my pen drive using vb.net code.
Thanks.
Gagan
|
|
|
|
|
Use the /c parameter switch to cmd.exe thus:
pr.StandardInput.WriteLine("/c format G:" & Convert.ToCha(13)) txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Thanks for your reply, but I have still some doubt.
Could you explain that a little bit more?
Thnaks.
Gagan
|
|
|
|
|
Gagan.20 wrote: Thanks for your reply, but I have still some doubt.
Could you explain that a little bit more?
What more is there to explain? Open a command prompt window and type "cmd /?" for explanation of the switches and parameter options.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
I have a doubt in the example you had suggested.
I am using a combo box to select drive name. In the code
Call SHFormatDrive(Me.hWnd, _
drvToFormat, _
SHFD_CAPACITY_DEFAULT, _
SHFD_FORMAT_QUICK)
where drvToFormat is declared as integer. When I am passing drive name to drvToFormat it is giving error that conversion from string to integer is not valid. What value should I paas as to drvToFormat to format my pen drive?
Thanks.
Gagan
|
|
|
|
|
You might want to read the documentation on SHFormatDrive[^]. You're passing in a string when you should be pass in a number. The number represents which drive to format. Read the documentation and you can figure out pretty easily, what that number is supposed to be.
|
|
|
|
|
Hi CP,
I am having a LineShape control with MouseDown,MouseUP,MouseMove events.
Dim fdragging As Boolean = False
Dim StartX, startY As Integer
Private Sub LineShape1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseDown
fdragging = True
StartX = e.X
startY = e.Y
End Sub
Private Sub LineShape1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseMove
If fdragging Then
LineShape1.StartPoint = New Point(LineShape1.StartPoint.X + e.X - StartX, LineShape1.StartPoint.Y + e.Y - startY)
LineShape1.EndPoint = New Point(LineShape1.EndPoint.X + e.X - StartX, LineShape1.EndPoint.Y + e.Y - startY)
End If
End Sub
Private Sub LineShape1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ShapeContainer1.MouseUp
fdragging = False
StartX = 0
startY = 0
End Sub
Now i am not able to move the lineshape control freely around the form with cursor like in the design time .
Cursor is changing the location so slipping happens .
How to stick the cursor to LineShape control.
Regards,For1206
|
|
|
|
|
|
Hi Dave ,
Already i am having selections , The problem is on mousemove the line control is moving but if the cursor goes out of the line control its not handling the mousemove i.e, Slipping of Cursor on the cursor . I tried to set the cursor location on the control but not working fine .
Regards,For1206
|
|
|
|