|
Hi, How can i get drive info(free/used space) in vs 2003?
(in vs 2005 there's the DriveInfo class)
thanks.
sh
|
|
|
|
|
Hi!
You can p/invoke GetDiskFreeSpaceEx to get this information.
Because GetDiskFreeSpaceEx returns ULARGE_INTEGER s, your p/invoke declaration should contain out long for these parameters.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello,
Yesterday I was trying to do the same thing and I found your post. Here is a solution I found:
<br />
System.Management.ManagementObject disk = new System.Management.ManagementObject("win32_logicaldisk.deviceid=\"c:\"");<br />
System.Management.PropertyData freeSpace = disk.Properties["FreeSpace"];<br />
Console.WriteLine("Free space on C: drive is: {0}", freeSpace.Value.ToString());<br />
You'll need to add a reference to System.Management to your project.
In this code snippet, freeSpace.Value will contain the amount of free space in bytes as a decimal number.
BDF
|
|
|
|
|
Can any one give me a brief description about what envoy sink, server context sink and object context sink does in .NET Remoting ?
Thanks in Advance
Phanindra...
|
|
|
|
|
using C#,searching data from the database by using key and print that information
(this database very big.)
|
|
|
|
|
we can't do your work.
What you have done for this so for?
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Is there any way to save the user's credentials to the database and re-use them?
I wanted to run all the threads and web-service calls as background processes using user's credentials.
I have tried to searilizing user's default credentials and it looks like that is not possible.
Is there any other options?
Please adivice,
Shrini Viswanathan
|
|
|
|
|
There is a way to pass the user credentials from a frontend application to a backend webservice. Even with the webservice using threads.
You only need to make sure that the webservice and the front-end work with the same credential store (Active directory) and that they use Security Impersonation. The front-end will impersonate the user that logs on to the application and use those credentials to access the webservice. If you enable impersonation on the service as well, you will have the same credentials there that can access resources.
You might want to lookup the documentation on the subject as I don't remember exactly which setting it was in web.config to enable the Security impersonation. Also you need to make sure that the web application(s) run as local system, otherwise impersonation doesn't work on windows 2003.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
My blog
|
|
|
|
|
hi all
I have been searching around but i havent found anything that JUST does what i need.
does anyone know a good link to a site that would show me how to connect to a sql DB and let me populate a dataset and then fill a datagridview
the database is currently read only so i don't need to worry about writing back to the db.
thanks in advance
Crash
|
|
|
|
|
Have you tried here[^]. There is a handy search function you can use.
only two letters away from being an asset
|
|
|
|
|
i start my timer than when timer is elapsed i want to change my sliderbars value in
private void timer1_elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
slider1.value=100; //i get error message in this line about threading and debug s broken.how can i solve it?
}
|
|
|
|
|
Hi,
you must be more specific:
- what kind of timer, there are at least three different Timer classes in CLR
- what Exception
My best guess is you are NOT using a Forms.Timer hence your timer is accessing
a Control from within a thread that did not create said Control, hence resulting
in an InvalidOperationException. If this suits your case, read up on
Control.InvokeRequired and Control.Invoke()
|
|
|
|
|
i get this message when i try to set sliderbar s value.System.InvalidOperationException.i used "using System.window.threading; "
i think i must break timer s threading than slider bar s valur could be changed.
|
|
|
|
|
So you have confirmed my assumption. You must:
either switch to a Forms.Timer
or call myControl.Invoke() instead of directly trying to change the Control
(read up on Invoke !).
|
|
|
|
|
please can you write code?i tried to write but i couldnt do it.
|
|
|
|
|
Hi,
I'm not going to do your work.
Did you try a Forms.Timer ? if not, why not ?
Did you read the MSDN documentation on your current timer ? and Forms.Timer ?
Did you try to call Invoke ? if so, show the code, and explain what happened.
If not, why not ? Did you at least search CodeProject for InvokeRequired/Invoke ?
and read an article about them ?
|
|
|
|
|
ok i have done it now.thanks all of so much good night
|
|
|
|
|
If your timer is running in a thread that doesn't own slider then you need to call Invoke methods. Have a look at this: http://msdn.microsoft.com/msdnmag/issues/04/02/TimersinNET/
|
|
|
|
|
i get this message when i try to set sliderbar s value.System.InvalidOperationException.i used "using System.window.threading; "
i think i must break timer s threading than slider bar s valur could be changed.
|
|
|
|
|
I am planning to develop an application using finger scanner so i want, which finger scanner is supported by c#, what is the SDK/library used for it and how to begin with it?
Abdus Sami
|
|
|
|
|
Why don't you use google? Just search for fingerprint sdk and you will definitely find one
|
|
|
|
|
Hi! There's some SDK's which you can use. If you want to start from easy SDK, I suggest you checking sourceforge project "Fingerprint Verification System":
FVS
I tried to search in Google and found some interesting links:
Google search
Hope this helps!
Timo Salomäki
|
|
|
|
|
I have created a picture viewer in C# but it's giving only one error, i don't know how to deal with it as i already faced lots of errors as i reduced it to one final error. I'm at beginner level in C#. So please help me in this, I have written the code and errors below, you can look at that.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
namespace WindowsApplication1<br />
{<br />
public partial class Myform : Form<br />
{<br />
private System.Windows.Forms.MenuItem menuFile;<br />
private System.Windows.Forms.MenuItem menuLoad;<br />
private System.Windows.Forms.MenuItem menuImage;<br />
private System.Windows.Forms.MenuItem menuExit;<br />
private System.Windows.Forms.MenuItem menuStretch;<br />
private System.Windows.Forms.MenuItem menuHelp;<br />
private System.Windows.Forms.MenuItem menuView;<br />
protected override void Dispose(bool dispose) { base.Dispose(dispose); }<br />
private PictureBox pboxPhoto;<br />
<br />
private void InitializeComponent()<br />
{<br />
this.menuFile = new System.Windows.Forms.MenuItem();<br />
this.menuLoad = new System.Windows.Forms.MenuItem();<br />
this.menuImage = new System.Windows.Forms.MenuItem();<br />
this.menuExit = new System.Windows.Forms.MenuItem();<br />
this.menuStretch = new System.Windows.Forms.MenuItem();<br />
this.menuExit = new System.Windows.Forms.MenuItem();<br />
this.menuView = new System.Windows.Forms.MenuItem();<br />
<br />
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuFile });<br />
this.menuFile.Index = 0;<br />
this.menuFile.Text = "&File";<br />
this.menuLoad.Index = 0;<br />
this.menuLoad.Shortcut = System.Windows.Forms.Shortcut.Ctrl;<br />
this.menuLoad.Text = "&Load";<br />
this.menuExit.Index = 1;<br />
this.menuExit.Text = "&Exit";<br />
<br />
menuView.Index = 1;<br />
menuView.Text = "&View";<br />
<br />
}<br />
<br />
public Myform()<br />
{<br />
this.Text = "Picture viewer";<br />
this.MinimumSize = new Size(200, 200);<br />
<br />
<br />
<br />
pboxPhoto = new PictureBox();<br />
pboxPhoto.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;<br />
pboxPhoto.Width = this.Width;<br />
pboxPhoto.Height = this.Height;<br />
pboxPhoto.Left = (this.Width - pboxPhoto.Width) / 2;<br />
pboxPhoto.Top = (this.Height - pboxPhoto.Height) / 2;<br />
pboxPhoto.SizeMode = PictureBoxSizeMode.StretchImage;<br />
pboxPhoto.Anchor = AnchorStyles.Top | AnchorStyles.Bottom<br />
| AnchorStyles.Left | AnchorStyles.Right;<br />
this.Controls.Add(pboxPhoto);<br />
<br />
<br />
}<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
protected void menuLoad_Click(object sender, System.EventArgs e)<br />
{<br />
menuLoad.Click += new System.EventHandler(this.menuLoad_Click);<br />
<br />
OpenFileDialog dlg = new OpenFileDialog();<br />
dlg.Title = "Open Photo";<br />
dlg.Filter = "jpg files (*.jpg)|*.jpg|All files (*.*)|*.*";<br />
if (dlg.ShowDialog() == DialogResult.OK)<br />
{<br />
try<br />
{<br />
pbxPhoto.Image = new Bitmap(dlg.OpenFile());<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show("Unable to load file: " + ex.Message);<br />
}<br />
<br />
dlg.Dispose();<br />
}<br />
}<br />
<br />
protected void menuExit_Click(object sender, System.EventArgs e)<br />
{<br />
this.Close();<br />
}<br />
private PictureBoxSizeMode[] modeMenuArray = null;<br />
}<br />
}<br />
This is the error message
Error Message:'WindowsApplication1.Form1.Dispose(bool)': no suitable method found to override.
Thanks a lot, i really need help in my project.
Mr.Dream_master
|
|
|
|
|
Hi,
the code you show contains a partial class, my best guess is in some other
part of that partial class (in another file, probably Form1.Designer.cs)
already is a definition of the Dispose(bool dispose) method.
So I suggest you try and remove the line
protected override void Dispose(bool dispose) { base.Dispose(dispose); }
from the code you have shown.
Anyway, look at the file name and line number Visual Studio shows when listing
the compiler errors.
|
|
|
|
|
well i tried the same you have told but it gave me warning plus same error. so i created this as override.
still not working having troubles.
Mr.Dream_master
|
|
|
|