none
Check if image exist on remote server

    Pertanyaan

  • <style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 33.0px Menlo; color: #000000} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 33.0px Menlo; color: #000000; min-height: 39.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #000000} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #000000; min-height: 16.0px} </style> Hi,

    I am trying to set image source in .NET Standard like this:

    ImageCenterMemberDetails.Source = ImageSource.FromUri(new Uri(string.Format("http://localhost/lakom/gallery/members/{0}.png", sql_reader.GetString(sql_reader.GetOrdinal("member_guid")))));

    


    but sometimes the image does not exist on the server

    so how can I check if an image exists then I will use the above otherwise I will show a default NpPhoto.png file?


    Thanks,
    Jassim


    Jumat, 24 Agustus 2018 07.47

Semua Balasan

  • Hi,

    Thank you for posting here.

    For your question, I have some questions to confirm with you.

    What is the type of your project? WPF? How do you get the image from remote server? What is your localhost? FTP?

    Please provide more details.

    Best Regards,

    Wendy



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Senin, 27 Agustus 2018 07.03
  • I am using Xamarin XAML with C# and I am connect to remote FTP with HTTPS
    Minggu, 02 September 2018 13.38
  • Hi Jassim Rahma,

    Since the question is related to Xamarin, you could post a new thread in Xamarin forum for suitable support.

    https://forums.xamarin.com/

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Senin, 03 September 2018 06.05