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.

c# - Detect the location of AppData\LocalLow -


i'm trying locate path appdata\locallow folder.

i have found example uses:

string folder = "c:\users\" + environment.username + @"\appdata\locallow"; 

which 1 tied c: , users seems bit fragile.

i tried use

environment.getfolderpath(environment.specialfolder.localapplicationdata) 

but gives me appdata\local, , need locallow due security constraints application running under. returned blank service user (at least when attaching process).

any other suggestions?

the environment.specialfolder enumeration maps csidl, there no csidl locallow folder. have use knownfolderid instead, shgetknownfolderpath api:

void main() {     guid locallowid = new guid("a520a1a4-1780-4ff6-bd18-167343c5af16");     getknownfolderpath(locallowid).dump(); }  string getknownfolderpath(guid knownfolderid) {     intptr pszpath = intptr.zero;     try     {         int hr = shgetknownfolderpath(knownfolderid, 0, intptr.zero, out pszpath);         if (hr >= 0)             return marshal.ptrtostringauto(pszpath);         throw marshal.getexceptionforhr(hr);     }         {         if (pszpath != intptr.zero)             marshal.freecotaskmem(pszpath);     } }  [dllimport("shell32.dll")] static extern int shgetknownfolderpath( [marshalas(unmanagedtype.lpstruct)] guid rfid, uint dwflags, intptr htoken, out intptr pszpath); 

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 -