Format:
Recent snippets matching language of 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();
3 Views
no comments
//FILE TRANSFER USING C#.NET SOCKET - SERVER class FTServerCode { IPEndPoint ipEnd; Socket sock; public FTServerCode() { ipEnd = new IPEndPoint(IPAddress.Any, 5656);
2 Views
no comments
/// <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
/// <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
using System; using System.Configuration; using System.Data.SqlClient; using System.Security.Cryptography; using System.Text; namespace ECO.WebServices.DataAccess { internal static class AuthDbConnection {
6 Views
no comments
using System; using System.Configuration; using System.Data.SqlClient; using System.Security.Cryptography; using System.Text; namespace ECO.WebServices.DataAccess { internal static class AuthDbConnection {
6 Views
no comments
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;
4 Views
no comments
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; }
5 Views
no comments
using System; using System.Diagnostics; using System.IO; using System.Text; namespace ConsoleRedirectionOfOutputForReal { class Program { static void Main(string[] args)
7 Views
no comments
using System.Collections.Generic; namespace Core.Types { /// <summary> /// A simple 3D vector type /// </summary> public class Vector { #region Constructors
5 Views
no comments
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");
5 Views
no comments
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;
8 Views
no comments
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>
11 Views
no comments
public class SimpleStack<T> { private class Node<V> { public Node<V> Next; public V Item; } private Node<T> head;
7 Views
no comments
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);
8 Views
no comments
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);
10 Views
no comments
/// <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];
7 Views
no comments
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { carregarValores(); carregarContratos(); configurarBotoes(); } }
8 Views
no comments
/// <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
8 Views
no comments
//----------------------------------------------------------------------- // <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;
7 Views
no comments
// Take into account exceptions might occur try { // some code here that's less funny ;-) } // Process exceptions catch (Exception ex) { }
61 Views
1 comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Integer_factorization { class Program { static void Main(string[] args)
10 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
