using MySql.Data.MySqlClient; string ConnectionString = "SERVER=localhost; USER=아이디; DATABASE=데이터베이스; PASSWORD=비밀번호;"; string sql = "select * from test"; DataSet ds = new DataSet(); MySqlConnection Conn = new MySqlConnection(ConnectionString); MySqlDataAdapter dataAdapter = new MySqlDataAdapter(sql, Conn); dataAdapter.Fill(ds,"test");
C#에는 2의 100승을 담을 수 있는 자료형이 없습니다 그래서 문자열로 표현해봤습니다 코드가 굉장히 복잡하네요 더 간단한 방법이 있을건데 저는 모르니까.ㅋㅋ 생각나는데로 해봤습니다 using System; using System.Collections.Generic; namespace ConsoleApp1 { class Program { static void Main(string[] args) { List z = new List(); z.Add(1); int plus = 0; int t = 0; for (int k = 0; k = 0; i--) { t = z[i] * 2; if (t >= 10) { z[i] = t % 10 + plus; plus = 1; } else { z[i] = t + plus; p..
public static string Encrypt(string textToEncrypt, string key) { RijndaelManaged rijndaelCipher = new RijndaelManaged(); rijndaelCipher.Mode = CipherMode.CBC; rijndaelCipher.Padding = PaddingMode.PKCS7; rijndaelCipher.KeySize = 128; rijndaelCipher.BlockSize = 128; byte[] pwdBytes = Encoding.UTF8.GetBytes(key); byte[] keyBytes = new byte[16]; int len = pwdBytes.Length; if (len > keyBytes.Length) ..
EncryptString(암호키, 암호화할 문자열); private static string EncryptString(string InputText, string KeyString) { RijndaelManaged RijndaelCipher = new RijndaelManaged(); byte[] PlainText = Encoding.Unicode.GetBytes(InputText); byte[] Salt = Encoding.ASCII.GetBytes(KeyString.Length.ToString()); PasswordDeriveBytes SecureKey = new PasswordDeriveBytes(KeyString, Salt); ICryptoTransform Encryptor = RijndaelCi..
Substring (int startIndex) - 원하는 위치부터 끝까지 string s = "0123456789";Console.WriteLine(s.substring(5)); // 결과 "56789" Console.WriteLine(s.substring(7)); // 결과 "789" Substring (int startIndex, int length) - 원하는 위치부터 문자 개수 Console.WriteLine(s.substring(5,2)); // 문자열 인덱스 5부터 2개의 문자를 반환 // 결과 "56"
DataTable d1 = new DataTable();DataTable d2 = new DataTable(); 두 테이블이 있을때 d1의 행을 d2로 복사하는 코드d2.Rows.Add(d1.Rows[0]); 이렇게 하면 아래와 같은 에러가 뜬다 System.ArgumentException : 이 행은 이미 다른 테이블에 속해 있습니다 이것은 테이블에 로우를 추가할때도 추가되는 로우는 각각의 객체가 아닌 주소만 복사되면서 발생하는 오류이다 해결방법 두가지 1. d2.ImportRow(d1.Rows[0]); 2. dt2.Rows.Add(dt1.Rows[0].ItemArray); 두가지 방법이 모두 값을 모두 복사하는 방식이다
- Total
- Today
- Yesterday
- NET FRAMEWORK
- c# SpeechSynthesizer
- c# Speech
- C# textbox 커서 위치
- imemode
- 암호화
- 이 행은
- MySQL
- 복호화
- 이베스트
- ESP32
- 방울토마토
- C# textbox 커서 마지막
- C# textbox 커서 시작
- 앉은뱅이 방울토마토
- 드론
- c# 음성
- 인삼키우기
- 코딩
- 베란다 텃밭
- framework
- 스털링
- c#
- 시스템트레이딩
- 베란다 방울토마토
- ArgumentException
- Xingapi
- 스털링엔진
- 베란타
- C# 마우스 폼이동
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |