Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

winapi - in Python, how to separate Local Hard Drives from Network and Floppy in Windows? -


i've been looking info awhile, , have number of ways retrieve list of local drives under windows. here 2 examples:

print win32api.getlogicaldrivestrings().split("\x00") 

and

def getdriveletters(self):     self.drvs = []     n_drives = win32api.getlogicaldrives()     in range(0,25): #check drive letters         j = 2**i # bitmask each letter         if n_drives & j > 0:             self.drvs.append(chr(65+i)+":/")     print self.drvs 

what can't seem find way separate floppies (a:), usb drives (g:), cd drives (e:), , network drives (p:) local hard drives (c:, d:)

if assigned same letters easy, i'm writing script monitor local hard disk space across network of computers different configurations.

any appreciated! thanks.

you can try win32 getdrivetype function.

import win32file >>> win32file.getdrivetype("c:/") == win32file.drive_fixed ##hardrive true >>> win32file.getdrivetype("z:/") == win32file.drive_fixed ##network false >>> win32file.getdrivetype("d:/") == win32file.drive_fixed ##cd-rom false 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -