c# pastebinden istediğim satırı çekmek istiyorum

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Banlı Üye
Katılım
26 Nis 2016
Mesajlar
933
Çözümler
2
Tepki puanı
228
Ödüller
6
10 HİZMET YILI
pastebin raw datadan seçtiğim bi satırdaki yazıyı çekmek istiyorum.

örneğin;

C#:
1. satır
2. satır
3. satır

ben burdan sadece 2. satırı çekmek istiyorum
 
#Ri
Coder
Katılım
17 Ocak 2016
Mesajlar
1,111
Çözümler
2
Tepki puanı
2,542
Ödüller
12
Yaş
9
10 HİZMET YILI
googlede ufak bi araştırmayla sonuç bulabilirsin.

C#:
private static List<string> DownloadLines(string hostUrl)
{

    List<string> strContent = new List<string>();

    var webRequest = WebRequest.Create(hostUrl);

    using (var response = webRequest.GetResponse())
    using (var content = response.GetResponseStream())
    using (var reader = new StreamReader(content))
        {
            while (!reader.EndOfStream)
            {
                strContent.Add(reader.ReadLine());
            }
        }
    return strContent;
}

Kullanım

C#:
var mLines = DownloadLines("https://pastebin.com/blabla");
var firstLine = mLines[0];
var secondLine = mLines[1];
 
bizler tanrının yetim çocuklarıyız
Ultra Üye
Katılım
24 May 2016
Mesajlar
1,659
Çözümler
18
Tepki puanı
507
Ödüller
13
Yaş
26
10 HİZMET YILI
googlede ufak bi araştırmayla sonuç bulabilirsin.

C#:
private static List<string> DownloadLines(string hostUrl)
{

    List<string> strContent = new List<string>();

    var webRequest = WebRequest.Create(hostUrl);

    using (var response = webRequest.GetResponse())
    using (var content = response.GetResponseStream())
    using (var reader = new StreamReader(content))
        {
            while (!reader.EndOfStream)
            {
                strContent.Add(reader.ReadLine());
            }
        }
    return strContent;
}

Kullanım

C#:
var mLines = DownloadLines("https://pastebin.com/blabla");
var firstLine = mLines[0];
var secondLine = mLines[1];
teşekkürler.
 
  • Konuyu başlatan
  • Yasaklandı
  • #6
Banlı Üye
Katılım
26 Nis 2016
Mesajlar
933
Çözümler
2
Tepki puanı
228
Ödüller
6
10 HİZMET YILI
googlede ufak bi araştırmayla sonuç bulabilirsin.

C#:
private static List<string> DownloadLines(string hostUrl)
{

    List<string> strContent = new List<string>();

    var webRequest = WebRequest.Create(hostUrl);

    using (var response = webRequest.GetResponse())
    using (var content = response.GetResponseStream())
    using (var reader = new StreamReader(content))
        {
            while (!reader.EndOfStream)
            {
                strContent.Add(reader.ReadLine());
            }
        }
    return strContent;
}

Kullanım

C#:
var mLines = DownloadLines("https://pastebin.com/blabla");
var firstLine = mLines[0];
var secondLine = mLines[1];
teşekkür ederim xmazecim <3


Ne Programı Yapıosunki
Kendime UI yapıyorum
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst