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 static class HttpPostedFileBaseExtensions | |
{ | |
public static Byte[] ToByteArray(this HttpPostedFileBase value) | |
{ | |
if (value == null) | |
return null; | |
var array = new Byte[value.ContentLength]; | |
value.InputStream.Position = 0; | |
value.InputStream.Read(array, 0, value.ContentLength); |
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
routes.MapRoute( | |
"", | |
"bilopphuggere/biler.aspx/{param}", | |
new { controller = "Huggere", action = "BilerRedirect", param = UrlParameter.Optional } | |
); |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- 20110224 : Ryan Milligan : Created OverrideAppConfigWithTargetPath target to fix ClickOnce deploy bug --> | |
<!-- 20100827 : João Angelo : Fixed bug when using Publish command within Visual Studio --> | |
<PropertyGroup> | |
<!-- Prevent circular dependency on Build target --> | |
<PipelineDependsOnBuild>false</PipelineDependsOnBuild> | |
<!-- Override project config file name (By default is set to Web.config) --> | |
<ProjectConfigFileName>App.Config</ProjectConfigFileName> | |
</PropertyGroup> |
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 FileStreamResult Download() | |
{ | |
var fullQualifiedPathToDll = Path.Combine(Server.MapPath("~/"), "bin/ImageResizer.dll"); | |
var fileInfo = new FileInfo(fullQualifiedPathToDll); | |
var myFileStream = new FileStream(fullQualifiedPathToDll, FileMode.Open); | |
return File(myFileStream, "application/octet-stream", fileInfo.Name); | |
} |
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
/// <summary> | |
/// A chainable query string helper class. | |
/// Example usage : | |
/// string strQuery = QueryString.Current.Add("id", "179").ToString(); | |
/// string strQuery = new QueryString().Add("id", "179").ToString(); | |
/// </summary> | |
public class QueryString : NameValueCollection | |
{ | |
public QueryString() | |
{ |
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
static public string AssemblyLoadDirectory | |
{ | |
get | |
{ | |
string codeBase = Assembly.GetCallingAssembly().CodeBase; | |
var uri = new UriBuilder(codeBase); | |
string path = Uri.UnescapeDataString(uri.Path); | |
return Path.GetDirectoryName(path); | |
} | |
} |
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
#r @"\\psf\Home\Desktop\GitHub\eulersfsharp\src\Euler\bin\Debug\FSharp.Data.dll" | |
#r @"\\psf\Home\Desktop\GitHub\eulersfsharp\src\packages\MSDN.FSharpChart.dll.0.60\lib\MSDN.FSharpChart.dll" | |
#r "System.Windows.Forms.DataVisualization.dll" | |
open FSharp.Data | |
open MSDN.FSharp.Charting | |
open System.Windows.Forms | |
open System.Drawing | |
open System.Windows.Forms.DataVisualization.Charting |
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
#r "../packages/HtmlAgilityPack.1.4.6/lib/Net45/HtmlAgilityPack.dll" | |
#r "../packages/FSharp.Data.1.1.10/lib/net40/FSharp.Data.dll" | |
#load "HtmlAgilityPack.FSharp.fs" | |
open System | |
open System.Linq | |
open System.Net | |
open System.Text.RegularExpressions | |
open FSharp.Net |
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
namespace NetsOcrParser | |
module OcrFileParser = | |
open System | |
open System.IO | |
open System.Globalization | |
type StartRecordForsendelse = | |
{ FormatKode : string; TjenesteKode : string; ForsendelsesType : string; RecordType : string; DataAvsender : string; ForsendelsesNummer : string; DataMottaker : string; Filler : string; } |
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
open System | |
open System.IO | |
type File = | |
{ Size: Int64; Name: String; Path: String; } | |
member x.IsLargerThan minSize = x.Size > minSize | |
type DuplicateFile = | |
{ Size: Int64; Name: String; Paths: String list; } |