Merhabalar;
Sunucumda bir klasörde bulunan resimleri, sunucudan çekip telefonuma kaydetmek istiyorum. Bir butonlada telefonda bulunan bu resimleri programa çekmek istiyorum. Bunun için ne yapabilirim? Bu işlemi yapabilmem için bir örnek yada link verebilirmisiniz?
Sunucudan dosya alıp telefona kaydetme
Re: Sunucudan dosya alıp telefona kaydetme
Merhaba,
Bir projemde istediğine benzer bir işi yaptım, kısa bir kod parçası umarım yol gösterici olur.
Bir projemde istediğine benzer bir işi yaptım, kısa bir kod parçası umarım yol gösterici olur.
Kod: Tümünü seç
procedure HaberObjeOlustur( ListView:TListView; yer, Id: Integer; strTarih, strHaber, urlResim, flnResim:String; IdHttp:TIdHttp );
var
LItem : TListViewItem;
MS : TMemoryStream ;
begin
ListView.BeginUpdate;
try
case yer of
-1 : LItem := ListView.Items.Add; //Normal listeleme ve Listeye ekleme
else LItem := ListView.Items.AddItem(yer);
end;
LItem.Text := '';
LItem.Tag := Id;
LItem.Data[TMultiDetailAppearanceNames.Detail1] := strTarih;
LItem.Data[TMultiDetailAppearanceNames.Detail2] := strHaber;
if FileExists(System.IOUtils.TPath.GetDocumentsPath + System.SysUtils.PathDelim +flnResim) then //Resim önceden alınmışsa yükle
begin
try
LItem.Bitmap.LoadFromFile(System.IOUtils.TPath.GetDocumentsPath + System.SysUtils.PathDelim + flnResim)
finally
end;
end
else // Yoksa indir
begin
try
MS := TMemoryStream.Create;
IdHttp.Get(urlResim, MS);
MS.Seek(0,soFromBeginning);
Ms.SaveToFile(System.IOUtils.TPath.GetDocumentsPath + System.SysUtils.PathDelim +flnResim);
LItem.Bitmap.LoadFromStream(MS);
finally
MS.Free;
end;
end;
finally
ListView.EndUpdate;
end;
end;
Re: Sunucudan dosya alıp telefona kaydetme
çok teşekkür ederim kadirkaya.
Re: Sunucudan dosya alıp telefona kaydetme
Rica ederim. Yardımcı olabildiysem ne güzel 
