PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework How to find out the free DiskSpace

Reply

How to find out the free DiskSpace

 
Thread Tools Rate Thread
Old 05-10-2005, 09:47 AM   #1
=?Utf-8?B?RG9jRGVhdGg=?=
Guest
 
Posts: n/a
Default How to find out the free DiskSpace


Hi,

i want to know the free DiskSpace of my StorageCard. But the CF does not
have the routines. Any Workaround with the normal CF? (without OpenNetCF)

Thanks a lot Benjamin Wagner
  Reply With Quote
Old 05-10-2005, 11:52 AM   #2
Sergey Bogdanov
Guest
 
Posts: n/a
Default Re: How to find out the free DiskSpace

The OpenNETCF sources are available, see how the method
OpenNETCF.IO.StorageCard.GetDiskFreeSpace was implemented here:
http://vault.netcf.tv/VaultService/...udedversions=20


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


DocDeath wrote:
> Hi,
>
> i want to know the free DiskSpace of my StorageCard. But the CF does not
> have the routines. Any Workaround with the normal CF? (without OpenNetCF)
>
> Thanks a lot Benjamin Wagner

  Reply With Quote
Old 05-10-2005, 11:54 AM   #3
Sergey Bogdanov
Guest
 
Posts: n/a
Default Re: How to find out the free DiskSpace

.... forgot this:

u/p: guest/guest


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


DocDeath wrote:
> Hi,
>
> i want to know the free DiskSpace of my StorageCard. But the CF does not
> have the routines. Any Workaround with the normal CF? (without OpenNetCF)
>
> Thanks a lot Benjamin Wagner

  Reply With Quote
Old 05-10-2005, 12:59 PM   #4
=?Utf-8?B?RG9jRGVhdGg=?=
Guest
 
Posts: n/a
Default Re: How to find out the free DiskSpace

Ok, whats the Login and the Password for this Page, or did you have another
Page?

best regards Benjamin

"Sergey Bogdanov" wrote:

> .... forgot this:
>
> u/p: guest/guest
>
>
> --
> Sergey Bogdanov [.NET CF MVP, MCSD]
> http://www.sergeybogdanov.com
>
>
> DocDeath wrote:
> > Hi,
> >
> > i want to know the free DiskSpace of my StorageCard. But the CF does not
> > have the routines. Any Workaround with the normal CF? (without OpenNetCF)
> >
> > Thanks a lot Benjamin Wagner

>

  Reply With Quote
Old 05-10-2005, 01:07 PM   #5
=?Utf-8?B?RG9jRGVhdGg=?=
Guest
 
Posts: n/a
Default Re: How to find out the free DiskSpace

Ok, thanks a lot. Try this out.

best regards Benjamin

"DocDeath" wrote:

> Ok, whats the Login and the Password for this Page, or did you have another
> Page?
>
> best regards Benjamin
>
> "Sergey Bogdanov" wrote:
>
> > .... forgot this:
> >
> > u/p: guest/guest
> >
> >
> > --
> > Sergey Bogdanov [.NET CF MVP, MCSD]
> > http://www.sergeybogdanov.com
> >
> >
> > DocDeath wrote:
> > > Hi,
> > >
> > > i want to know the free DiskSpace of my StorageCard. But the CF does not
> > > have the routines. Any Workaround with the normal CF? (without OpenNetCF)
> > >
> > > Thanks a lot Benjamin Wagner

> >

  Reply With Quote
Old 05-10-2005, 01:30 PM   #6
=?Utf-8?B?RG9jRGVhdGg=?=
Guest
 
Posts: n/a
Default Re: How to find out the free DiskSpace

Ok, it works. Thanks a lot. Where can i get a documentation about the
Coredll.dll?

For those who need it in VB.net (like me):

Option Strict On
Option Explicit On

Imports System.Runtime.InteropServices

Module SpezialFunktionen

#Region " GetFreeSpace "

<DllImport("coredll.dll")> Private Function GetDiskFreeSpaceEx( _
ByVal directoryName As String, _
ByRef freeBytesAvailable As Long, _
ByRef totalBytes As Long, _
ByRef totalFreeBytes As Long) As Boolean
End Function

Public Function GetFreeDiskSpace(ByVal directoryName As String) As Long
Dim FreeBytesAvailable As Long
Dim TotalBytes As Long
Dim TotalFreeBytes As Long
If GetDiskFreeSpaceEx(directoryName, FreeBytesAvailable, TotalBytes,
TotalFreeBytes) Then
Return FreeBytesAvailable
Else
Return Nothing
End If
End Function

#End Region

End Module

best regards Benjamin Wagner





"DocDeath" wrote:

> Ok, thanks a lot. Try this out.
>
> best regards Benjamin
>
> "DocDeath" wrote:
>
> > Ok, whats the Login and the Password for this Page, or did you have another
> > Page?
> >
> > best regards Benjamin
> >
> > "Sergey Bogdanov" wrote:
> >
> > > .... forgot this:
> > >
> > > u/p: guest/guest
> > >
> > >
> > > --
> > > Sergey Bogdanov [.NET CF MVP, MCSD]
> > > http://www.sergeybogdanov.com
> > >
> > >
> > > DocDeath wrote:
> > > > Hi,
> > > >
> > > > i want to know the free DiskSpace of my StorageCard. But the CF does not
> > > > have the routines. Any Workaround with the normal CF? (without OpenNetCF)
> > > >
> > > > Thanks a lot Benjamin Wagner
> > >

  Reply With Quote
Old 05-10-2005, 01:39 PM   #7
Sergey Bogdanov
Guest
 
Posts: n/a
Default Re: How to find out the free DiskSpace

You can find almost all functions in MSDN, e.g. GetDiskFreeSpaceEx:
http://msdn.microsoft.com/library/d...freespaceex.asp


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


DocDeath wrote:
> Ok, it works. Thanks a lot. Where can i get a documentation about the
> Coredll.dll?
>
> For those who need it in VB.net (like me):
>
> Option Strict On
> Option Explicit On
>
> Imports System.Runtime.InteropServices
>
> Module SpezialFunktionen
>
> #Region " GetFreeSpace "
>
> <DllImport("coredll.dll")> Private Function GetDiskFreeSpaceEx( _
> ByVal directoryName As String, _
> ByRef freeBytesAvailable As Long, _
> ByRef totalBytes As Long, _
> ByRef totalFreeBytes As Long) As Boolean
> End Function
>
> Public Function GetFreeDiskSpace(ByVal directoryName As String) As Long
> Dim FreeBytesAvailable As Long
> Dim TotalBytes As Long
> Dim TotalFreeBytes As Long
> If GetDiskFreeSpaceEx(directoryName, FreeBytesAvailable, TotalBytes,
> TotalFreeBytes) Then
> Return FreeBytesAvailable
> Else
> Return Nothing
> End If
> End Function
>
> #End Region
>
> End Module
>
> best regards Benjamin Wagner
>
>
>
>
>
> "DocDeath" wrote:
>
>
>>Ok, thanks a lot. Try this out.
>>
>>best regards Benjamin
>>
>>"DocDeath" wrote:
>>
>>
>>>Ok, whats the Login and the Password for this Page, or did you have another
>>>Page?
>>>
>>>best regards Benjamin
>>>
>>>"Sergey Bogdanov" wrote:
>>>
>>>
>>>>.... forgot this:
>>>>
>>>>u/p: guest/guest
>>>>
>>>>
>>>>--
>>>>Sergey Bogdanov [.NET CF MVP, MCSD]
>>>>http://www.sergeybogdanov.com
>>>>
>>>>
>>>>DocDeath wrote:
>>>>
>>>>>Hi,
>>>>>
>>>>>i want to know the free DiskSpace of my StorageCard. But the CF does not
>>>>>have the routines. Any Workaround with the normal CF? (without OpenNetCF)
>>>>>
>>>>>Thanks a lot Benjamin Wagner
>>>>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off