View CheckBrowserAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
namespace MvcApplication1.Models | |
{ | |
public class CheckBrowserAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuted(ActionExecutedContext filterContext) | |
{ | |
base.OnActionExecuted(filterContext); | |
} |
View Global.asax.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
using System.Web.Routing; | |
using MvcApplication1.Models; | |
namespace MvcApplication1 | |
{ | |
public class MvcApplication : System.Web.HttpApplication | |
{ | |
public static void RegisterGlobalFilters(GlobalFilterCollection filters) | |
{ |
View LoginRequiredAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Web.Mvc; | |
namespace MvcApplication1.Models | |
{ | |
public class LoginRequiredAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
if (filterContext.HttpContext.Session["isLogIn"] == null) | |
filterContext.Result = new RedirectResult("~/Home/Login"); |
View gist:847125
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Mikrotik.Api; | |
namespace Usage | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var variable = new Firewall("192.168.2.8", "admin", "password") | |
.Chain(Targets.forward) |
View gist:847133
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Mikrotik.Api; | |
namespace Usage | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//TODO : Create Mikrotik backup | |
var variable = new RouterOs("192.168.2.8", "admin", "password") |
View gist:847137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Mikrotik.Api; | |
namespace Usage | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//TODO : Add new user, disable, enable and remove Mikrotik user. | |
var variable = new Users("192.168.2.8", "admin", "password") |
View gist:856761
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var cmd = new Executor(); | |
dynamic commandItem = RemoteServer.GetCommandItemFromRemoteServer(); //return Object; | |
cmd.ExecuteCommand(commandItem); | |
Console.ReadKey(); |
View WhoisCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Oğuzhan YILMAZ | |
// Web : www.oguzhan.info | |
// Email : aspsrc@gmail.com | |
// 12/13/2011 | |
namespace PoshWhois | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; |
View gist:1515732
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Before_1() | |
{ | |
string Year = ""; | |
string Month = ""; | |
string Week = ""; | |
string Day = ""; | |
} |
View gist:1515735
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void After_1() | |
{ | |
string Year, Month, Week, Day = String.Empty; | |
} |
OlderNewer