This file contains hidden or 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 string GetDataURL(string imgFile) | |
{ | |
return "<img src=\"data:image/" | |
+ Path.GetExtension(imgFile).Replace(".","") | |
+ ";base64," | |
+ Convert.ToBase64String(File.ReadAllBytes(imgFile)) + "\" />"; | |
} |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.IO; | |
namespace KlerksSoft | |
{ | |
public static class TextFileEncodingDetector | |
{ | |
/* |
This file contains hidden or 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 void HttpUploadFile(string url, string file, string paramName, string contentType, NameValueCollection nvc) { | |
log.Debug(string.Format("Uploading {0} to {1}", file, url)); | |
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x"); | |
byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n"); | |
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url); | |
wr.ContentType = "multipart/form-data; boundary=" + boundary; | |
wr.Method = "POST"; | |
wr.KeepAlive = true; | |
wr.Credentials = System.Net.CredentialCache.DefaultCredentials; |
This file contains hidden or 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; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Media; | |
using System.Windows.Media.Imaging; | |
namespace SDKSample | |
{ | |
public partial class FormatConvertedBitmapExample : Page | |
{ |
This file contains hidden or 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
// Copyright © 2010-2015 The CefSharp Authors. All rights reserved. | |
// | |
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
using System.Windows.Controls; | |
using System.Windows.Input; | |
using CefSharp.Example; | |
using CefSharp.Wpf.Example.Handlers; | |
namespace CefSharp.Wpf.Example.Views |
This file contains hidden or 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 AsyncHelper | |
{ | |
/// <summary> | |
/// Execute's an async Task<T> method which has a void return value synchronously | |
/// </summary> | |
/// <param name="task">Task<T> method to execute</param> | |
public static void RunSync(Func<Task> task) | |
{ | |
var oldContext = SynchronizationContext.Current; | |
var synch = new ExclusiveSynchronizationContext(); |
This file contains hidden or 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 Test() { | |
NetOffice.WordApi.Application app = null; | |
NetOffice.WordApi.Document doc = null; | |
try | |
{ | |
var tempFile = new FileInfo(path).CopyTo(Path.GetTempFileName(), true); | |
app = new NetOffice.WordApi.Application(); | |
app.Visible = false; | |
app.DisplayAlerts = WdAlertLevel.wdAlertsNone; |
This file contains hidden or 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
* { -webkit-tap-highlight-color: rgba(0,0,0,0); } |
This file contains hidden or 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
body { | |
font-family: "Hiragino Sans GB","华文细黑","STHeiti","微软雅黑","Microsoft YaHei",SimHei,"Helvetica Neue",Helvetica,Arial,sans-serif; | |
font-size: 14px; | |
} |
OlderNewer