csharp

DataBase butt joint:
if(DataBase.Exists)
{
come on!
Attention :localhost、port、DataBasename 、username、password
picture path
}
if(!DataBase.Exists)
{
first: to find DataBase server exists visual tool connection DB( find username password through xml)
second: butt joint
}
if(!table.fields.Exists)
{
find view select * from viewname
}
DataBaseResotre:SQL Server Restore:
mdf文件 附加進行還原
將mdf文件以及l(fā)og.mdf日志文件全部拷貝到SQL Server數(shù)據(jù)庫的安裝目錄下
的DATA文件夾下,然后進行找到該目錄 找到mdf文件 進行還原

Download files from ftp:
WebClient wc = new WebClient();
wc.Headers.add("User_Agent","Chrome");
wc.credentials = new NetworkCredential("username", "password");
wc.DownloadFile("ftp://10.4.8.202:26/download.txt","c://download1.txt");

Download picture from Internet:
Core code:(WebClient function is visit url)
WebClient wc = new WebClient();
wc.Headers.add("User_Agent","Chrome");
wc.downloadFile("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1521534886900&di=80d30358851dd53dcebb152fc76291ca&imgtype=0&src=http%3A%2F%2Fupload.news.cecb2b.com%2F2016%2F0327%2F1459067610166.jpg", @"D:\ftp\image3.gif");

IoStreamFile/Folder:
Folder:
string path = @"c:\MyDir";
Directory.CreateDirectory(path);
File(create file and write):
string path = @"c:\MyDir\file1.txt";
FileStream fr = new FileSteam(path,FileMode.CreateNew);
StreamWrite sw = new StreamWrite(fr);
sw.write("This is write to path");
File(read):
string line ;
StringReader sr = new StringReader(path);
while(line = sr.Reader() != null)
{
Console.WriterLine(line.toString()); }

Csharp中解決生成多個隨機數(shù)重復問題:
int randnew = new Random(Guid.NewGuid().GetHashCode()).Next(0, 10);

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

  • Spring Cloud為開發(fā)人員提供了快速構建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,578評論 19 139
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc閱讀 2,993評論 0 0
  • 經驗:1.在網(wǎng)絡端接收數(shù)據(jù)后寫入本地時要用write(byte[],0,len),不要用write(byte[])...
    123yuan123閱讀 452評論 0 2
  • “初見的時候絕對不知道后來會這么喜歡你” 我想我會開始想念你,可是我剛剛才遇見了你很想和你擁有一個很長很長的未來,...
    木有昵稱耶閱讀 199評論 0 1
  • 1.在AndroidManifest文件中增加了一種叫做android:resizableActivity的屬性值...
    優(yōu)雨閱讀 1,386評論 0 0

友情鏈接更多精彩內容