Format:
Recent snippets matching tags of Url
var baseUrl; var applicationUrl; baseUrl = document.location.href; baseUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/')); applicationUrl = baseUrl.substring(0, baseUrl.lastIndexOf('/'));
17 Views
no comments
using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Web; namespace System.Text { public static class StringTransformer { static readonly string linkFormat = "<a href=\"{0}\" title=\"{0}\" target=\"{2}\" class=\"{3}\">{1}</a>"; /// <summary>
105 Views
no comments
//using System.Web; //to return "http://www.samplepage.com/Egli/index.aspx" string url = HttpContext.Current.Request.Url.AbsoluteUri; //to return "/Egli/index.aspx" string path = HttpContext.Current.Request.Url.AbsolutePath; //to return "www.samplepage.com" string host = HttpContext.Current.Request.Url.Host;
169 Views
no comments
/// <summary> /// Get the file that will be read/written to /// </summary> /// <returns></returns> public UnifiedFile GetFileFromProperty(PageData page, string propertyName) { var filePath = page.Property[propertyName] != null ? (string)page.Property[propertyName].Value : string.Empty; if (string.IsNullOrEmpty(filePath)) return null;
292 Views
no comments
NSData *soundData = [NSData dataWithContentsOfURL:url]; AVAudioPlayer *avPlayer = [[AVAudioPlayer alloc] initWithData:soundData error: nil]; [avPlayer play];
557 Views
no comments
DECLARE_EVENT_TABLE() /*************************************************************** * Name: downloadMain.h * Purpose: Defines Application Frame * Author: (alan) * Created: 2008-11-14 * Copyright: (谦泰通讯) * License: **************************************************************/
206 Views
no comments
public static class TinyUrl { private static readonly Random Random = new Random(); public static string Get() { int random = Random.Next(); return Base62ToString(uint.MaxValue); }
293 Views
no comments
public class URLRewriterModule : IHttpModule { /// <summary> /// You will need to configure this module in the web.config file of your /// web and register it with IIS before being able to use it. For more information /// see the following link: http://go.microsoft.com/?linkid=8101007 /// </summary> #region IHttpModule Members public void Dispose()
382 Views
no comments
<?php function search_string($start , $end , $from, $number=1){ if($number<1){ $number=1; } $from = trim(str_replace("\r\n","",$from)); $i = 0; $ans = $from; if(!stristr($ans , $start)){ return false;
523 Views
no comments
public static class zlnkREST { static string CONST_UN = "twtmug"; // User your own UserName in Case you wanna track all your posts, static string CONST_Service = "http://zlnk.net/zlink.svc/"; static string CONST_GetOriginalURL = "GetOriginalLink?ShortCode={0}&UN={1}"; static string CONST_Shorten = "CreateShortLink?oUrl={0}&UN={1}"; static string CONST_Default = "http://twtmug.com/"; public static string ShortenURL(string strUrl) {
214 Views
no comments
/// <summary>
/// URL-encodes a string for use with OAuth.
/// </summary>
/// <param name="toEncode">
/// The string to encode.
/// </param>
/// <returns>
/// A URL-encoded string where all of the encoded characters are upper-case.
/// </returns>
/// <remarks>
425 Views
no comments
/// <summary> /// This method returns a fully qualified absolute server Url which includes /// the protocol, server, port in addition to the server relative Url. /// /// Works like Control.ResolveUrl including support for ~ syntax /// but returns an absolute URL. /// </summary> /// <param name="ServerUrl">Any Url, either App relative (~/default.aspx) /// or fully qualified</param> /// <param name="forceHttps">if true forces the url to use https</param>
1564 Views
1 comments
//Generate an object like "window.location"(href,protocol,host,hostname,port,pathname,search,hash) //Or return false function fnConvertHref(href) { var pattern = /([a-z]+):\/\/([^\/:]+):?([\d]*)\/?([^?]*)\??([^#]*)#?([^#]*)/gi; if (pattern.test(href)) { return { 'href' : href, 'protocal' : RegExp.$1, 'host' : RegExp.$2 + RegExp.$3,
260 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
