Format:
Recent snippets matching tags of Form
// this code requires a reference to JSON.NET in your project #if true using System; using System.Net.Http.Formatting; using System.Threading.Tasks; using System.Web.Script.Serialization; using System.Json; using Newtonsoft.Json; using System.IO;
671 Views
no comments
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="PublishWeb" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /> <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <ClassLibraryOutputDirectory>bin$(Configuration)</ClassLibraryOutputDirectory> <WebProjectFile>$(ProjectFolder)\$(ProjectFile)</WebProjectFile> </PropertyGroup>
72 Views
no comments
protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current.Request.IsAuthenticated) { ResetFormsAuthenticationTicket(); } else { Response.Redirect("~/logout.aspx"); }
43 Views
no comments
static void Main(string[] args) { Console.WriteLine(PhoneNumber("12345678901234")); Console.WriteLine(PhoneNumber("1234567890123")); Console.WriteLine(PhoneNumber("123456789012")); Console.WriteLine(PhoneNumber("12345678901")); Console.WriteLine(PhoneNumber("1234567890")); Console.WriteLine(PhoneNumber("123456789")); Console.WriteLine(PhoneNumber("12345678")); Console.WriteLine(PhoneNumber("1234567"));
105 Views
no comments
string strFormatedGuid = Guid.NewGuid().ToString("N"); //Where N is the format, can be any of the ones described below /* Format: N Output 32 digits: 00000000000000000000000000000000 Format: D Output 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000
97 Views
no comments
// create date time 2008-03-09 16:05:07.123 DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123); String.Format("{0:y yy yyy yyyy}", dt); // "8 08 008 2008" year String.Format("{0:M MM MMM MMMM}", dt); // "3 03 Mar March" month String.Format("{0:d dd ddd dddd}", dt); // "9 09 Sun Sunday" day String.Format("{0:h hh H HH}", dt); // "4 04 16 16" hour 12/24 String.Format("{0:m mm}", dt); // "5 05" minute String.Format("{0:s ss}", dt); // "7 07" second String.Format("{0:f ff fff ffff}", dt); // "1 12 123 1230" sec.fraction
96 Views
no comments
// Just two decimal places String.Format("{0:0.00}", 123.4567); // "123.46" String.Format("{0:0.00}", 123.4); // "123.40" String.Format("{0:0.00}", 123.0); // "123.00" // Max. two decimal places String.Format("{0:0.##}", 123.4567); // "123.46" String.Format("{0:0.##}", 123.4); // "123.4" String.Format("{0:0.##}", 123.0); // "123"
93 Views
no comments
<ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule>
127 Views
no comments
using System; using System.Collections.Generic; using System.Xml.Linq; using FizzWare.NBuilder; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Tests.Reporting { [TestClass] public class DynamicXmlFormatting
158 Views
no comments
using System; using System.Collections.Generic; using FizzWare.NBuilder; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Tests.Reporting { [TestClass] public class DynamicTextFormatting {
171 Views
no comments
select * from INFORMATION_SCHEMA.COLUMNS where table_name not like 'v%' order by TABLE_NAME, ORDINAL_POSITION select * from INFORMATION_SCHEMA.ROUTINES select * from INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE SELECT s.name [SPECIFIC_SCHEMA], o.name [SPECIFIC_NAME], s.name [ROUTINE_SCHEMA], o.name [ROUTINE_NAME], case when o.[type] in ('P', 'PC') then 'PROCEDURE' when o.type in ('V') then 'VIEW'
97 Views
no comments
// action code $em = $this->get('doctrine')->getEntityManager(); $categories = $em->getRepository('CMSBackBundle:Category')->findAll(); $choices = array(); foreach ( $categories as $k => $v ) { $choices[$v['id']] = $v['title']; }
316 Views
no comments
const string PC_CATEGORY = "_Tmp"; const string PC_NAME = "_Tmp"; if (!PerformanceCounterCategory.Exists(PC_CATEGORY)) { CounterCreationDataCollection data = new CounterCreationDataCollection(); CounterCreationData counter = new CounterCreationData(PC_NAME, "", PerformanceCounterType.NumberOfItems32); var pcCategory = PerformanceCounterCategory.Create(PC_CATEGORY, "", PerformanceCounterCategoryType.MultiInstance, data); data.Add(counter);
177 Views
no comments
<Rectangle Width="100" Height="100" Fill="RoyalBlue" Margin="20"> <Rectangle.RenderTransform> <TransformGroup> <ScaleTransform CenterX="50" CenterY="50" ScaleX="1.5" ScaleY="1.5" /> <RotateTransform CenterX="50" CenterY="50" Angle="5" /> </TransformGroup> </Rectangle.RenderTransform> </Rectangle>
292 Views
no comments
namespace WindowsFormsApplication1 { public partial class Form1 : System.Windows.Forms.Form { public Form1() { InitializeComponent(); // create list of data var _List = new System.Collections.Generic.List<Data>
1709 Views
1 comments
Produto
Disco rigido Samsung SATA 2 1TB 5400RPM R$ 183,00
Disco rigido Samsung SATA 2 320GB P/NOTE 5400RPM R$ 146,00
DVD-RW LG GH22NS50 SATA R$ 50,00
DVD-RW LG SECURDISC IDE - Preto R$ 70,00
Fone de Ouvido Philips - SHP2700/00 R$ 83,00
Fonte Coletek ATX LC-8220BS2 200W 20+4 SATA R$ 38,00
Fonte Kmex ATX PX-300RMF 200W 20+4 SATA R$ 37,00
Fonte Kmex ATX PX-350RNF 230W 20+4 SATA R$ 39,00
320 Views
no comments
/// <summary> /// Returns the content of the POST buffer as string /// </summary> /// <returns></returns> public static string FormBufferToString() { HttpRequest Request = HttpContext.Current.Request; if (Request.TotalBytes > 0) return Encoding.Default.GetString(Request.BinaryRead(Request.TotalBytes));
292 Views
no comments
<ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > <DataTemplate x:Key="SmallLogoTemplate"> <Image ... /> </DataTemplate> <DataTemplate x:Key="LargeLogoTemplate"> <Image ... />
156 Views
no comments
public class YourPlugin : IPlugin { private static ResourceDictionary _Resources; public static DataTemplate SmallIconTemplate { get {
179 Views
no comments
int intValue = 1512; string stringValue = intValue.ToString("#,#", CultureInfo.GetCultureInfo(Thread.CurrentThread.CurrentCulture.Name)); /* Result in US English (en-US) will be 1,512 Result in Swedish (sv-SE) will be 1 512 */
330 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
