using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Win32; namespace RegistryTest { class Program { static void Main(string[] args) { string subkey = "Software\\RegistryTest"; RegistryKey key = Registry.LocalMachine.OpenSubKey(subkey,true); if (key == null) { key = Registry.LocalMachine.CreateSubKey(subkey); } // set..
//DllImport iniusing System.Runtime.InteropServices; //StringBuilderusing System.Text; //DllImport ini[DllImport("kernel32")] private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); [DllImport("kernel32")]private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath)..
//ServerSystem.Net.Sockets.UdpClient udpClient = new System.Net.Sockets.UdpClient("127.0.0.1", 5555);String cmd = "dump";System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();byte[] dgrams = encoding.GetBytes(cmd);udpClient.Send(dgrams, dgrams.Length);udpClient.Close(); //Clientstatic private UdpClient udpServer;static private byte[] data;static private IPEndPoint ipep = new IPEnd..
public class BmpLoader { public struct BMPHeader { public short type; public int size; public short reserved1; public short reserved2; public int offset; } public struct BMPInfoHeader { public int size; public int width; public int height; public short planes; public short bitsPerPixel; public uint compression; public uint imageSize; public int xPelsPerMeter; public int yPelsPerMeter; public int..
파일을 읽을때 유니코드 문제를 드디어 해결했다. 문제는 Encoding parameter부분이 default parameter가 Encoding.Default가 아니라는 점이다. 따라서 명시적으로 Default Encoding이라고 해주어야 한다. FileStream fs = new FileStream(fn, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs, Encoding.Default); string s = sr.ReadLine();
ParseHTML이라는 외부 라이브러리로 HTML을 파싱해보자. using System; using System.Collections.Generic; using System.Linq; using System.Text; using HTML; using System.IO; namespace ParseHTMLTester { class Program { static void Main(string[] args) { StreamReader reader = new StreamReader("1.txt");// html을 1.txt로 저장해 놓음 HTML.ParseHTML parse = new HTML.ParseHTML(); // 스트림 리터에서 파일 전체를 string으로 변경 string data = reader.R..
마영전 서버가 C#으로 개발되었습니다. 마영전 서버 세션 정리 http://www.scribd.com/doc/57921356/ndc2011-%EB%A7%88-%EB%B9%84-%EB%85%B8-%EA%B8%B0-%EC%98%81-%EC%9B%85-%EC%A0%84-%EC%84%9C-%EB%B2%84-%EA%B4%80-%EB%A0%A8-%EC%84%B8-%EC%85%98-%EC%A0%95-%EB%A6%AC C#으로 게임 서버를 개발 할 경우 성능에 대한 글 http://rosagigantea.tistory.com/408 NDC 참관기: 마비노기 영웅전 자이언트 서버의 비밀 https://rein.kr/blog/archives/2671 게임코디 쓰레드 http://www.gamecodi.com/board/z..
- Total
- Today
- Yesterday