Sleep in C#

28/03/2018 Nosomovo 0

Nếu bạn đang viết một ứng dụng với ngôn ngữ C#. Và muốn cho ứng dụng ngủ 1 vài mili giây thì đây là code bạn cần nhé: System.Threading.Thread.Sleep(1); //Sleep 1 milisecond Application.DoEvents(); //Continute do some code after sleep Trong đó: Dòng thứ nhất: cho ngủ 1 mili giây. Dòng

Không có ảnh

Bộ sưu tập code đồ án Web HTML

26/03/2018 Nosomovo 0

Gửi các bạn bộ sưu tập các đồ án web html, css, javascript cho người mới bắt đầu học lập trình web. – Link mediafire: Bấm để truy cập thư mục. Nosomovo

Không có ảnh

CSS Thanh cuộn – Scroll bar CSS

23/03/2018 Nosomovo 0

Nếu bạn muốn làm đẹp cho thanh cuộn – scroll bar cho website của mình thay vì sử dụng scroll bar mặc định của trình duyệt. Bạn có thể sử dụng đoạn mã css bên dưới để làm điều này. ::-webkit-scrollbar { width: 5px; } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0

Không có ảnh

Mysql connection string in C#

05/03/2018 Nosomovo 0

string Connectionstring = “SERVER=” + m_Server + “; PORT=” + m_Port + “;” + ” DATABASE=” + m_Database + “;” + “UID=” + m_UserName + “;” + “PASSWORD=” + m_PassWord + “; CharSet=utf8; POOLING=TRUE;”; nosomovo

Không có ảnh

Excel connection string in C#

05/03/2018 Nosomovo 0

string ConnectionString = “Provider=Microsoft.ACE.OLEDB.12.0; Data Source=” + “filename” + “; Extended Properties=\”Excel 12.0\”;”; Nosomovo

Không có ảnh

Sql server connection string in C#

05/03/2018 Nosomovo 0

Kết nối bằng quyền Windows: string m_ConnectString = “Data Source=” + “servername” + “;Initial Catalog=” + “databasename” + “;Integrated Security=True;”; Kết nối bằng quyền User: string m_ConnectString = “Data Source=” + “servername” + “;Initial Catalog=” + “databasename” + “;User Id=” + “username” + “;Password=” + “pasword” + “;”; Nosomovo

Không có ảnh

Code PHP – Chuyển nhiều mảng đơn thành một mảng 2 chiều

26/02/2018 Nosomovo 0

/* Hàm chuyển nhiều mảng một chiều thành mảng 2 chiều Ví dụ: $arr_cacmang1chieu=array( ‘col_1’=>array(‘A’,’B’,’C’), ‘col_2’=>array(‘D’,’E’,’F’) ); Sau khi chuyển kết quả sẽ là: $arr_mang2chieu=array( 0=>array( ‘col_1’=>’A’, ‘col_2’=>’D’ ), 1=>array( ‘col_1’=>’B’, ‘col_2’=>’E’ ), 2=>array( ‘col_1’=>’C’, ‘col_2’=>’F’ ) ) */ function multiArrayTotwodimensionArray($array,$remotenullrow=false) { $arr_Return=null; $maxlen=0; if(!empty($array)) { //Count Max len of

Lệnh cấu hình tài khoản git

23/02/2018 Nosomovo 0

Để cấu hình tài khoản git sau khi đã cài đặt git vào máy chúng ta dùng 2 lệnh sau: git config –global user.email “you@example.com” git config –global user.name “Your Name”   Nosomovo

Không có ảnh

Code C# – Upload file to web server

26/01/2018 Nosomovo 0

  public class HttpUploadHelper { private HttpUploadHelper() { } public static string Upload(string url, UploadFile[] files, NameValueCollection form) { HttpWebResponse resp = Upload((HttpWebRequest)WebRequest.Create(url), files, form); using (Stream s = resp.GetResponseStream()) using (StreamReader sr = new StreamReader(s)) { return sr.ReadToEnd(); } } public static HttpWebResponse Upload(HttpWebRequest req, UploadFile[] files, NameValueCollection form)

Code C# – Thao tác với Registry của windows

26/01/2018 Nosomovo 0

Lớp myRegistry bên dưới cung cấp cho ta các hàm thao tác với Registry của windows như: Đọc giá trị của 1 key. Đăng ký key và gi giá trị của key vào registry. Xóa key đã đăng ký. public sealed class myRegistry { /// <summary> /// Method is used to read

Không có ảnh

Code C# – Thực hiện các phép toán trên tập hợp

26/01/2018 Nosomovo 0

Lớp Set  bên dưới sẽ cung cấp cho chúng ta các hàm thực hiện các phép toán trên tập hợp như: Giao, hợp, hiệu: class Set { private string m_Set = “”; #region Contructors public Set(string str_set) { this.m_Set = str_set; } #endregion #region Properties public string SET { get

Không có ảnh

Code C cài đặt thuật toán sắp xếp chọn trực tiếp – Selection Sort

20/11/2017 Nosomovo 0

//Minh hoa thuat Selection Sort #include<stdio.h> #include<conio.h> int Mang[10]={10,9,8,7,6,5,4,3,2,1}; int X; void SelectionSort(int mang[],int n) { int i,j,tam; for(i=0;i<n;i++) { int min=i; for(j=i+1;j<n;j++) if(mang[j]<mang[min]) min=j; tam=mang[i]; mang[i]=mang[min]; mang[min]=tam; } } void inday(int mang[],int n) { int vt; for(vt=0;vt<n;vt++) printf(“%d “,mang[vt]); } void main() { clrscr(); printf(“Day truoc khi sap xep\n”);

Không có ảnh

Code C cài đặt thuật toán tìm kiếm tuyến tính – Linear search

20/11/2017 Nosomovo 0

// Tim kiem tuyen tinh (LinearSearch) #include<stdio.h> #include<conio.h> int LinearSearch1(int Day[],int n,int x) { int vitri=0; while(vitri<n&&Day[vitri]!=x) vitri++; if(vitri==n) return -1; else return 1; } int LinearSearch2(int Day[],int n,int x) { int vitri=0; while(vitri<n&&Day[vitri]!=x) vitri++; if(vitri==n) return -1; else return vitri; } int Mang[10]={1,2,3,4,5,6,7,8,9,10}; int X; void main() { clrscr();

Không có ảnh

Code C đổi số hệ cơ số 10 sang các hệ cơ số khác

20/11/2017 Nosomovo 0

/*———————————————- Chuong trinh doi co so he 10 ra co so n bat ky ———————————————–*/ #include <conio.h> #include <stdio.h> typedef int ElementType; struct Node { ElementType Element; Node *Next; }; typedef Node *Stack; typedef Node *Position; void MakeNullStack(Stack S) { S->Next=NULL; } Position Pop(Stack S) { return S->Next; } void

Không có ảnh

Code C minh họa danh sách liên kết sử dụng con trỏ

20/11/2017 Nosomovo 0

/* —————————————————————————– – Su Dung Con Tro / ———————————————– a) nhap ds so nguyen b) Sap xep giam c) Tong cac so nguyen la so 9 phuong d) in ket qua vua tinh e) Sap xep theo phuong phap noi bot f) Tong cac so nguyen to trong danh sach