|
Nilish wrote: Is there any equivalant vb.net code of the following vb6 code
Dim wp As WINDOWPLACEMENT
WINDOWPLACEMENT is a Win32 API structure - should be available to you in .NET too... maybe you just need to import a DLL into your app.
|
|
|
|
|
Yes , it was an api.I just got to know.I downloaded a chunk of code from internet.I mistakenly , downloded some incomplete code.
well Thanks for the reply.
|
|
|
|
|
Nope - you generally have to match the structure of Win32 structs within .NET code, there's no dll that has them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I currently using VB.NET, database is stored on sever, can i use vb.net to get database from server?
Socheat
................
|
|
|
|
|
in the connection string , give the path of the server
|
|
|
|
|
Can u give me an example?
................
|
|
|
|
|
If u r using MS-Access
this kind of connection string is required
dim connectionstring as string=
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\servername\d\database.mdb"
|
|
|
|
|
How can i get servername, if someone change server name it will automatic change, what does "d" stand for?
-- modified at 4:24 Thursday 17th May, 2007
-- modified at 4:29 Thursday 17th May, 2007
................
|
|
|
|
|
Sir,
d is the drive name (d drive) it was merely considered for an example basis.
if somebody changes the serve name then change the connection string.
simple!!!
|
|
|
|
|
How come, whether the application is installed on client machine, I want to change it automatically.
................
|
|
|
|
|
sorry i am not getting u.Can u please explain?
|
|
|
|
|
I mean that i had a app and installed on client machine with network group, in app i used the server name. Example "Socheat". if you someone change server name it will automatically change so, how can i do? beside not rename server name
................
|
|
|
|
|
I mean that my app is installed on client machine with the server name "SOCHEAT", if someone change server name, i would like it change automatically.
................
|
|
|
|
|
do one thing
create an extra form
invoke three textboxes there
1 for location where the database is located
2 for the username
3 for password
whenever u want to change these terms , pass there parameters to the connection string.
Simple !!!!!!!!!!!!
|
|
|
|
|
Give me an example if u can
................
|
|
|
|
|
if u know the functions , u can do it pretty easily.
|
|
|
|
|
Sorry to disturb you again, the connection string with the server name it will define whether found network or not?
................
|
|
|
|
|
Hi,
I have a drive called "Games".
How can i get that label in vb.net? (volume label?)
Thanks in regard,
--Zaegra--
|
|
|
|
|
For Each str As System.IO.DriveInfo In DriveInfo.GetDrives()<br />
MessageBox.Show(str.VolumeLabel)<br />
Next
|
|
|
|
|
Set a reference to Microsoft Scripting Runtime (COM)
Add
Imports Script
Then:
Dim fso as New FileSystemObject
Dim drv as Drive
drv=fso.GetDrive("C")
MessageBox.Show ("Volume: " & drv.VolumeName)
Vuyiswa
|
|
|
|
|
Thanks 
|
|
|
|
|
Hi,
I have a drive called "Games". How can I get this in vb.net? I have tried the following:
Dim attr As FileAttribute = Microsoft.VisualBasic.GetAttr("D:\")
Dim str as string = attr.ToString()
labProg.text = attr
It does not work
Does anyone know how to get the label of a drive?
Thanks in regard,
--Zaegra--
|
|
|
|
|
|
Hi there
i have two forms named form1 and form2 two class files named class1.vb , class2.vb
now in class1 the code is as follows
class class1
protected overrides sub Finalize()
mybase.Finalize
End Sub
end class
class2 code is as follows
class class2
protected overrides sub Finalize()
mybase.Finalize
End Sub
end class
In form1 i am writing the following code
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim d1 as new form2
d1.show
End Sub
End Class
In form2 i am writing the following code
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim d1 as new class1
End Sub
End Class
The startup page is form1
At form1 loads i am getting form2 automatically.
now i am closing the form2 .
Now
at the form2 closing event i am writing the following code.
GC.Collect
even this is not realeasing the class2 object memory.
Why is this happening?
I know ............
The Finalize method does not run when the object goes out of
scope. At that point, the object is simply not used any more but
the program doesn't destroy it.
Instead the program just ignores it until it starts to run out of
memory and it needs to perform garbage collection. Then it scans
all of the objects that the program has been using and
determines which ones are no longer in use. Only then does it
call the object's Finalize method
|
|
|
|
|
Nilish wrote: GC.Collect
NEVER do that. You have no reason to, you're just fighting the system and slowing it down.
Nilish wrote: protected overrides sub Finalize()
mybase.Finalize
End Sub
This code is obviously worthless, unless you have it just to set a breakpoint.
Forms are also special. The system likes to just hide them rather than dispose of them. Again, the framework is pursuing strategies to maximise performance, which is why you should just let it do it's thing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|