New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching language of C#
C#
else // Hydration/Patency grid
           {
               if (isNewRow)
               {
                   // create a new monitor
                   EnteralFluidEditDataObject gedo = new EnteralFluidEditDataObject();
                   gedo.IsDeleteButtonVisible = false;
 
                   PhysicianOrderDS primaryDS = childRow.Table.DataSet as PhysicianOrderDS;
                   PhysicianOrderDS.ResPhysOrderEnteralFluidRow newRow = primaryDS.ResPhysOrderEnteralFluid.NewResPhysOrderEnteralFluidRow();
Today @ 12:49pm
Tags:
3 Views
no comments
 
C#
//FILE TRANSFER USING C#.NET SOCKET - SERVER
class FTServerCode
{
IPEndPoint ipEnd;
 
Socket sock;
public FTServerCode()
{
ipEnd = new IPEndPoint(IPAddress.Any, 5656);
Today @ 12:45pm
Tags:
2 Views
no comments
 
C#
/// <summary>
/// Return all properties from a type up to a specified base type in the inheritance hierarchy
/// </summary>
/// <param name="type">Type that will be examined</param>
/// <param name="baseType">Where to stop in the inheritance hierarchy. Must be a type that first parameter inherits from
/// </param>
/// <returns>A list of all found properties</returns>
public static List<PropertyInfo> GetAllProperties(Type type, Type baseType)
{
   List<PropertyInfo> properties = new List<PropertyInfo>();
11 Views
no comments
 
C#
/// <summary>
/// Return all properties from a type up to a specified base type in the inheritance hierarchy
/// </summary>
/// <param name="type">Type that will be examined</param>
/// <param name="baseType">Where to stop in the inheritance hierarchy. Must be a type that first parameter inherits from
/// </param>
/// <returns>A list of all found properties</returns>
public static List<PropertyInfo> GetAllProperties(Type type, Type baseType)
{
   List<PropertyInfo> properties = new List<PropertyInfo>();
14 Views
no comments
 
C#
using System;
using System.Configuration;
using System.Data.SqlClient;
using System.Security.Cryptography;
using System.Text;
 
namespace ECO.WebServices.DataAccess
{
    internal static class AuthDbConnection
    {
Today @ 9:42am
Tags:
6 Views
no comments
 
C#
using System;
using System.Configuration;
using System.Data.SqlClient;
using System.Security.Cryptography;
using System.Text;
 
namespace ECO.WebServices.DataAccess
{
    internal static class AuthDbConnection
    {
by CRH   Today @ 9:26am
Tags:
6 Views
no comments
 
C#
using System.Net;
using System.Net.Sockets; 
//Create the server socket of the type Stream and using the TCP protocol.  
serversocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
serversocket.Blocking = true ; 
//Bind the Server to the port and keep listening on the port for client connections .. 
IPHostEntry IPHost = Dns.Resolve(server); 
string []aliases = IPHost.Aliases; 
IPAddress[] addr = IPHost.AddressList; 
Today @ 3:40am
Tags:
4 Views
no comments
 
C#
public IEntity GetFromReader(IDataReader reader)
        {
            QueueItem entity = new QueueItem();
            entity.PrimaryQueueID = DataMapper.IsNull<long>(reader["PrimaryQueueID"], new long());
            entity.PaymentRequest = DataMapper.IsNull<string>(reader["PaymentRequest"], string.Empty);
 
            return (IEntity)entity;
        }
Today @ 2:45am
5 Views
no comments
 
C#
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
 
namespace ConsoleRedirectionOfOutputForReal
{
    class Program
    {
        static void Main(string[] args)
Yesterday @ 1:09pm
Tags:
7 Views
no comments
 
C#
using System.Collections.Generic;
 
namespace Core.Types
{
    /// <summary>
    /// A simple 3D vector type
    /// </summary>
    public class Vector
    {
        #region Constructors
by VJ   Yesterday @ 1:06pm
Tags:
5 Views
no comments
 
C#
public static string Scramble(this string input)
        {
            var bytes = Encoding.Default.GetBytes(input);
 
            var encryptor = algorithm.CreateEncryptor();
            var outputBytes = encryptor.TransformFinalBlock(bytes, 0, bytes.Length);
 
            var output = "";
            for (var i = 0; i < outputBytes.Length; i++)
                output += outputBytes[i].ToString("x2");
by couellet   Yesterday @ 10:12am
Tags:
5 Views
no comments
 
C#
public void test_getStratumFromASite_should_onlyGetStratumFromTheSite()
    {
        HibernateUtil.beginUnitOfWork();
        IStratumRepo stratumRepo = RepositoryFactory.getSTRATUM_REPO();
        ISite[] sites = {
                new Site(),
                new Site()
        };
        //This number has no importance besides being > 1
        int numStrataPerSite = 10;
Yesterday @ 12:06am
Tags:
8 Views
no comments
 
C#
namespace Xterprise.Clarity.Ars.BusTerminal
{
    using System;
    using System.ServiceModel;
    using Xterprise.Clarity.Ars.Commands.ForInventory;
    using Xterprise.Clarity.Ars.Contracts;
 
    /// <summary>
    /// Controls the services which are hosted as wcf endpoints.
    /// </summary>
by Barry Forrest   Tuesday @ 1:34pm
Tags:
11 Views
no comments
 
C#
public class SimpleStack<T>
{
    private class Node<V>
    {
        public Node<V> Next;
        public V Item;
    }
 
    private Node<T> head;
by jaras   Tuesday @ 9:22am
Tags:
7 Views
no comments
 
C#
for(int i=0;i<10;i++)
{
Console.WriteLine("Hello");
}
Tuesday @ 8:23am
Tags: test
9 Views
no comments
 
C#
public void Connect()
{
try
{
Int32 port = 11115;
TcpClient client = new TcpClient(txtIPaddr.Text, port);
// ipAddr is a string containing the ip address of the server
 
string message = ("IS ANYBODY THERE?");
Byte[] data = System.Text.Encoding.ASCII.GetBytes(message);
Tuesday @ 4:44am
Tags:
8 Views
no comments
 
C#
public void StartServer()
{
try
{
IPAddress myIP = IPAddress.Parse("127.0.0.1");
Int32 port = 11115;
 
// Set up a TCP Listener
TcpListener server = new TcpListener(myIP, port);
Tuesday @ 4:42am
Tags:
10 Views
no comments
 
C#
/// <summary>
   /// Pegando o ID do contrato selecionado.
   /// </summary>
   /// <param name="sender"></param>
   /// <param name="e"></param>
   protected void gdwContratos_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
   {
       try
       {
           GridViewRow linha = gdwContratos.Rows[e.NewSelectedIndex];
Monday @ 3:26pm
Tags:
7 Views
no comments
 
C#
protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            carregarValores();
            carregarContratos();
            configurarBotoes();
        }
    }
Monday @ 3:24pm
Tags:
8 Views
no comments
 
C#
/// <summary>
    /// Função para realizar a liquidação do contrato.
    /// </summary>
    /// <param name="idContrato">ID do contrato a ser liquidado fechado ou cancelado.</param>
    /// <param name="flagContrato">0 - Aberto, 1 - Pago, 2 - Cancelado</param>
    /// <returns></returns>
    private bool liquidarRefinanciarContrato(int idContrato, int flagContrato)
    {
        
        try
Monday @ 3:21pm
Tags:
8 Views
no comments
 
C#
//-----------------------------------------------------------------------
// <copyright file="Util.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
 
namespace OpenIdProviderWebForms.Code {
    using System;
    using System.Web;
    using DotNetOpenAuth.OpenId;
by Andreas Grech   Monday @ 12:33pm
Tags:
7 Views
no comments
 
C#
Teste
by renatoperson   Monday @ 10:41am
Tags: Teste
6 Views
no comments
 
C#
// Take into account exceptions might occur
try
{
  // some code here that's less funny ;-)
}
// Process exceptions
catch (Exception ex)
{
}
by dvdstelt   Monday @ 12:53am
Tags: dailywtf
61 Views
1 comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Integer_factorization
{
    class Program
    {
        static void Main(string[] args)
by Flotto   Sunday @ 7:57am
10 Views
no comments
 
C#
// MAIN PAGE:
 
<Grid x:Name="LayoutRoot">
    
   <custom:SpellBar x:Name="PrimarySpellBar" ToolTipService.ToolTip="test" VerticalAlignment="Top" HorizontalAlignment="Left"/>
 
</Grid>
 
// SPELL BAR: 
 
Sunday @ 1:59am
Tags:
7 Views
no comments
 
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate