Public static string logpath {get {string Path = string. empty; Path = environment. getfolderpath (environment. specialfolder. commonprogramfiles) + @ "\ microsoft shared \ Web Server Extensions \ 12 \ logs \"; if (! Directory. exists (PATH) {Path = @ "C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ logs \" ;}return path ;}} public static void write (string message) {filestream FS = NULL; streamwriter Sw = NULL; try {spsecurity. runwithelevatedprivileges (delegate {FS = file. open (string. format ("{0} posterscopeusa notification-{1}-{2}-{3 }. log ", logpath, datetime. now. year, datetime. now. month, datetime. now. day), filemode. append); Sw = new streamwriter (FS); Sw. write (string. format ("{0} \ r \ n {1} \ r \ n", datetime. now, message); Sw. close (); Sw. dispose (); FS. close (); FS. dispose () ;}) ;}catch {} finally {Sw = NULL; FS = NULL ;}}