Skip to content

Instantly share code, notes, and snippets.

namespace System.Web.Mvc
{
#region Using
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc.Html;
using System.ComponentModel;
using System.Linq.Expressions;
/**
* Show or hide the button depending on the scroll position.
*/
function animateButton() {
var button = $('#back-to-top');
var scrollPosition = $(window).scrollTop();
if (scrollPosition > 400) {
button.fadeIn();
} else {
button.fadeOut();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Runtime.InteropServices;
namespace SimpleConsole
{
/// <summary>
/// Gets the console secure password.
/// </summary>
/// <returns></returns>
private static SecureString GetConsoleSecurePassword( )
{
SecureString pwd = new SecureString( );
while ( true )
{
using System;
using System.IO;
using System.Linq;
using System.Text;
namespace AbpWebSite.Templates
{
/// <summary>
/// Used to rename a solution
/// </summary>
@rqx110
rqx110 / HomeController.cs
Last active March 9, 2018 03:46 — forked from hikalkan/HomeController.cs
扩展IRepository,支持批量插入
//Demo usage
public class HomeController : MyControllerBase
{
private readonly IRepository<MyEntity> _myEntityRepository;
public HomeController(IRepository<MyEntity> myEntityRepository)
{
_myEntityRepository = myEntityRepository;
}
@rqx110
rqx110 / AbpSessionExtensions.cs
Created November 24, 2016 05:11 — forked from hikalkan/AbpSessionExtensions.cs
Creating an overridable session for ABP
using System;
using Abp.Runtime.Session;
namespace Abp.Temp
{
public static class AbpSessionExtensions
{
public static IDisposable Override(this IAbpSession abpSession, int? tenantId, long? userId)
{
var overridableSession = abpSession as OverridableSession;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MyApp.Hmac
{
public static class AuthenticationConstants
{
@rqx110
rqx110 / showMultiTiff.cs
Created December 6, 2017 12:19 — forked from ochilab/showMultiTiff.cs
C#でマルチページ形式のTiff画像を表示する方法(Form編)
private void showMultiTiff(string tiffFileName){
FileStream tifFS = new FileStream( tiffFileName , FileMode.Open , FileAccess.Read ) ;
Image gim = Image.FromStream( tifFS ) ;
FrameDimension gfd = new FrameDimension(gim.FrameDimensionsList[0]);
int pageCount = gim.GetFrameCount( gfd ) ;//全体のページ数を得る
System.Diagnostics.Debug.WriteLine(pageCount);
Graphics g = pictureBox1.CreateGraphics();
for(int i=0;i<pageCount;i++){
gim.SelectActiveFrame(gfd, i);
g.DrawImage(gim, 0,0, pictureBox1.Width, pictureBox1.Height);//PictureBoxに表示してます