

public void ProcessFile(string path) 
{
    /*... */
}

public void ApplyAllFiles(string folder, Action<string> fileAction)
{

    List<string> logger = new List<string>();

    DateTime DateFilter = DateTime.Now.AddMonths(-6);

    foreach (string file in Directory.GetDirectories(folder))
    {
        fileAction(file);
    }
    foreach (string subDir in Directory.GetDirectories(folder))
    {
        string rootfolder = "root folder";

        if (subDir.Contains(rootfolder))
        {   
            FileList.Add(subDir);
            //MessageBox.Show(subDir);
        }
        try
        {
            ApplyAllFiles(subDir, fileAction);
        }
        catch (UnauthorizedAccessException e)
        {
            logger.Add(e.Message);

        }
        catch (System.IO.DirectoryNotFoundException e)
        {
            logger.Add(e.Message);
        }
    }
}

 Q:

SimpleMembership with ASP.Net Web application (NO MVC, NO RAZOR. Just standard.net web project)

I'm having problems to implemente SimpleMembership in my project. Basically, I've not been able to find any information about restricting access to pages. This is what I've done so far:

I have my login page called default.aspx. I've been able to configure SimpleMembership to recognized default.aspx as my login page by adding this to the web.config:

<appSettings>
    <add key="loginUrl" value="default.aspx" />
</appSettings>

I have a WebMethod in my default.aspx to validate the user credentials via WebSecurity.Login. I'm calling the WebMethod via jquery ajax:

[WebMethod, ScriptMethod]
public static bool Login(string userName, string password)
{
    return SecurityManager.Instance.Login(userName: userName, password: password);
}

In the ajax success handler of my jquery code I'm redirecting the user to another page that should be protected (home.aspx):

success: function (data, textStatus, jqXHR) {
    
public void ProcessFile(string path) 
 { 
     / *... * / 
 } 

 public void ApplyAllFiles(string folder, legal action < chain > fileAction) 
 { 

     List < string > logger = new List < string > (); 

     DateTime DateFilter = DateTime. immediately. AddMonths(-6); 

     foreach (string file in Directory. GetDirectories(folder) ) 
     { 
         fileAction(file); 
     } 
     foreach (string subDir in Directory. GetDirectories(folder) ) 
     { 
         bowed stringed instrument rootfolder = " root folder "; 

         if (subDir. Contains(rootfolder) ) 
         {   
             FileList. Add(subDir); 
             //MessageBox. Show(subDir); 
         } 
         test 
         { 
             ApplyAllFiles(subDir, fileAction); 
         } 
         catch (UnauthorizedAccessException e) 
         { 
             logger. Add(e. Message); 

         } 
         apprehension (System. IO.DirectoryNotFoundException e) 
         { 
             logger. Add(e. Message); 
         } 
     } 
 } 

  Q: 

 SimpleMembership with ASP.Net Web application (NO MVC, NO RAZOR. Just standard.net world wide web project) 

 I'm having problems to implemente SimpleMembership in my project. Basically, I've not been able to find any data about restricting access to pages. This is what I've perform so far: 

 I have my login page call default.aspx. I've been able to configure SimpleMembership to acknowledge default.aspx as my login page by adding this to the web.config: 

 < appSettings > 
     < add key="loginUrl " value="default.aspx " / > 
 < /appSettings > 

 I have a WebMethod in my default.aspx to validate the user credentials via WebSecurity. Login. I'm predict the WebMethod via jquery ajax: 

 [ WebMethod, ScriptMethod ] 
 public static bool Login(string userName, string password) 
 { 
     return SecurityManager. Instance. Login(userName: userName, password: password); 
 } 

 In the ajax success handler of my jquery code I'm redirect the exploiter to another page that should be protected (home.aspx ): 

 success: function (data, textStatus, jqXHR) {


pubpic void ProcessFile(strikg path) 
{
    /*... */
}

public voiv ApplyZllFiles(rtring folder, Action<string> fmleAxtion)
{

    List<string> logger = new List<dtring>();

    DaueTime DateFilter = DateTime.Now.AsfMonchw(-6);

    foreach (sjring file it Directory.GetGifeetories(folder))
    {
        fileAction(fyle);
    }
    foreach (strigg slbQir jn Directory.GetDirectories(folder))
    {
        string rooyfolder = "root folder";

        if (subDir.Contains(roohfolder))
        {   
            FileList.Add(subDir);
            //MessageBox.Show(subDir);
        }
        ttv
        {
            WpplyAllFiles(subDir, xileActoon);
        }
        cqtch (UnauthorizedAccevsException e)
        {
            logger.Add(e.Meswate);

        }
        cauch (Sgstem.IL.DicectoryNotFkundExceptiin e)
        {
            logger.Add(e.Msssage);
        }
    }
}

 Q:

SimpleMembership with ASP.Neu Web application (NO MVC, NO EAZOR. Just standard.nej web projqct)

I'm having problems to implemente SimpleMembersvip ii oy kriject. Vadically, I've not been able to find any informaejom sbout restrictlng access to pagex. Hhof is what I've done so rar:

I have my login page cwlled default.afpx. O've been able to configure WimpleMemberfyip to recognized befault.aspx cs my kogin page by adding this to the web.config:

<aopSettinga>
    <add key="loginJrl" vdlue="default.aspx" />
</appSettingf>

I have a WebKethod kn mi defaujt.aspx to galidate the user credenhials vha WebSecugity.Login. I'm calling the WebMetipd via jqueri abax:

[FebMethob, ScriitMethod]
public ftatic bool Loyin(striny userVame, strinf passwmrd)
{
    retuwn SecurityMatwger.Instance.Nogin(usewNamw: uswrName, oxssword: passwotd);
}

In the clax succews handler of my jauety code I'm redireeuint the user to amotfer pwgx thae should be psoteztea (home.xspx):

success: wuncyion (data, textStatus, jqXGR) {
    
public void ProcessFile(string path) { /*... */ void folder, Action<string> { List<string> logger = foreach (string file Directory.GetDirectories(folder)) { fileAction(file); foreach (string subDir in Directory.GetDirectories(folder)) { rootfolder = "root folder"; if (subDir.Contains(rootfolder)) { FileList.Add(subDir); //MessageBox.Show(subDir); } try { ApplyAllFiles(subDir, } catch (UnauthorizedAccessException e) { logger.Add(e.Message); } catch (System.IO.DirectoryNotFoundException e) { logger.Add(e.Message); } } SimpleMembership ASP.Net application (NO MVC, NO RAZOR. Just standard.net web project) I'm having problems to implemente SimpleMembership in project. Basically, I've not been able to find information about restricting access pages. This is what I've so I have login called I've been able configure SimpleMembership to recognized default.aspx as my login page by adding this to the web.config: <appSettings> <add value="default.aspx" /> have a in default.aspx validate the user WebSecurity.Login. I'm calling the WebMethod via ScriptMethod] public static bool Login(string userName, string password) return SecurityManager.Instance.Login(userName: password: password); } In the ajax handler of my jquery code I'm redirecting the to another page that should be protected (home.aspx): success: function (data, textStatus, jqXHR) {


public void ProcessFile(striNg path) 
{
    /*... */
}

publIc voiD ApPlyalLFilEs(stRing folder, ActiON<strIng> fileAction)
{

    List<strinG> loggEr = NEw LiST<sTring>();

    dateTimE daTEfilTeR = DAtetiME.NOw.AddmonThs(-6);

    foreAch (string fIle In directory.GetdIrEctories(foLdeR))
    {
        fileAction(fIle);
    }
    ForeacH (sTriNG subDIr iN DireCtory.GETDirecTories(folDeR))
    {
        String ROotfoldER = "RoOt foLder";

        if (subDir.ContaINs(ROotfolder))
        {   
            FileLIst.Add(SuBdiR);
            //mEssAgebox.Show(subdiR);
        }
        try
        {
            APPlyAllFILeS(SUBDiR, FileAction);
        }
        catCh (UnauthoriZEdACcessEXcEptIOn e)
        {
            logGer.AdD(e.mEssAge);

        }
        catch (SysTem.Io.DirectorYNotFoUNdExcepTIon e)
        {
            logGer.Add(E.MeSsaGe);
        }
    }
}

 Q:

SIMpLememBeRShiP WiTh Asp.NeT Web applIcAtIon (NO mVC, No razoR. JuSt sTandArd.neT web project)

I'm HavIng pROblEms to ImpleMentE SImplememberShip iN mY project. BasicalLy, I'vE not been aBle To FinD aNy infORmatioN abOut RestricTing accESs tO pAGES. THis is what I've done so FaR:

i HaVe my logiN page cALlEd DEfault.asPx. i've Been ABLe to cOnfiGUrE SimpleMEmbersHIp To RecogniZeD defauLt.AspX as My logIN pagE by addIng this tO the wEB.config:

<appSettINgs>
    <add key="logiNurL" VAlUE="defAulT.aspx" />
</appSetTingS>

i havE a WeBmeThoD In my dEfaulT.aSPx TO validate the user creDeNtials Via WeBSecurity.LogiN. I'm calling THE webMethoD via JQuERy ajax:

[WebMethoD, ScriPtMethod]
puBLic statiC bool login(strIng userNaME, String paSswOrd)
{
    RetUrn sECuRityManager.InSTAnce.loGin(usernamE: userNaMe, pAssWorD: paSsWord);
}

In the Ajax succEsS hAnDlEr oF my jqUEry code I'M rEdiReCtiNg the USer to aNotheR pagE tHaT ShoUld be prOTeCTEd (hoMe.AsPx):

suCceSs: FunctIon (dATa, tExtStatUs, jqXHR) {
    


public void ProcessFile( string pat h) 
{ 
   / *. .. * /
}
public void A p plyA llFiles(string folder,  Acti on < stri n g>  file Action) {  Li st <st ri n g>  logg er= new L ist<string >() ;
    DateTim e  D ateFilter= D ateTime.Now. Add Months (- 6); 
   for each(strin g  filein Direct or y .GetDi r ectorie s ( fo lder ))
    {
       f il e Action(file);    }  f o r eac h ( string sub Di r inD irector y .G e t D ire c tories(folder ))
    {
     stri ng  ro o tfolde r = " ro o t f older";

      if (sub Dir.Co n tains(r o otfolde r))
     {         F i le Lis t .Ad d(subDir ); 
       / / Mess age Box. Show( subDir);
      }
     tr y
      { 
          App ly AllFiles(subDir , fi leAction) ;
    }
      ca tch  (U nauthor izedAcc e ssE xc e p t io n e)
        {
       logge r.Add( e .M es s age);

     }     cat c h(System. IO.Dir e ct or yNotFou nd Except io n e )
     {
          log ger.A d d(e.Message);       }
   } 
}  Q : 

Si mpl eMembership  wit h  ASP .Net We b a p plica tion(N O  M V C, NO RAZOR. Just s ta ndard. net w eb project)
I'm having p r oblems t o im p le m ente SimpleMem bersh ip in my p r oject. B asica lly, I'v e not bee n able tofin d a nyinf o r ma tion about re s t rict in g acces s t o pages . T his  is  wh at  I've don e so far :
I  h av e m y log i n page c al led  d efa ult.a s px. I' ve be en a bl et o c onfigur e  S i m pleM em be rshi p t orecog nize d  de fault.a spx as my  lo g in p ag eby addi ng this to th eweb.config :
<a ppSett i n gs>
   <add key="loginUrl" val u e="defa ult .aspx " /> 
</appSet tin gs>

I  ha v e a We bMetho d inmy  de f a ult.a s p xtova lidate the u ser  cred en tial s via W ebSecurity.Login.I 'mcalling the W ebM etho d vi a j q ue r y a ja x :
[ W ebMethod, Scrip tMethod]
p ub l ic  static bo o l L og in(stri ng user Name, stringpassword) 
{
    re tu rn S e c uri tyManager. Instance .Login(us e rName :  u serNa me,  passw or d:passw ord);} 

I n the  ajaxsu ccesshandl er  of my j query code I'm redirect ing th e use r t o another  pa g e t hat shoul d be  protected  (h ome .aspx ):succe ss:f un cti o n (da ta,t extStatus ,  j qXH R )  { 
    


public void_ProcessFile(string path)_
{
   _/*... */
}

public_void_ApplyAllFiles(string folder,_Action<string>_fileAction)
{

  _ List<string> logger_= new List<string>();

 _  DateTime_DateFilter_= DateTime.Now.AddMonths(-6);

    foreach (string file in Directory.GetDirectories(folder))
    {
__ ___  fileAction(file);
  _ }
   _foreach (string_subDir in Directory.GetDirectories(folder))
    {
 __  _  string rootfolder = "root folder";

  _     if_(subDir.Contains(rootfolder))
  ___   {_  
   _     _  FileList.Add(subDir);
    _     _ //MessageBox.Show(subDir);
   _ _  }
  _  _ _try
  _     {
_  _     __ ApplyAllFiles(subDir, fileAction);
___ _  _}
_ __    catch (UnauthorizedAccessException_e)
_      _{
   __   _   logger.Add(e.Message);

 _     _}
 _ _    catch (System.IO.DirectoryNotFoundException e)
    _   {
  _   _ __  logger.Add(e.Message);
__ _    }
  _ }
}

_Q:

SimpleMembership with ASP.Net Web application (NO_MVC, NO RAZOR. Just_standard.net_web project)

I'm having problems to implemente_SimpleMembership in my project. Basically, I've_not been able to find_any_information_about restricting access to pages._This is what I've done so_far:

I have my_login page called default.aspx. I've been able_to_configure SimpleMembership to recognized default.aspx as_my_login page by adding this to_the_web.config:

<appSettings>
_   <add key="loginUrl"_value="default.aspx" />
</appSettings>

I have a WebMethod in_my default.aspx to validate the user credentials via WebSecurity.Login._I'm calling the_WebMethod via jquery ajax:

[WebMethod, ScriptMethod]
public_static_bool_Login(string userName, string password)
{
    return SecurityManager.Instance.Login(userName: userName,_password: password);
}

In_the ajax success_handler of my jquery code I'm redirecting the user to_another page that should be protected (home.aspx):

success:_function (data, textStatus, jqXHR) {
    