Xamarin Android read text or image files

Published: 30 January 2021
on channel: Ammar Sharshara
2,138
18

how to add file and read it
طريقة اضافة ملف وقراءة الملف سواء نصي صورة
الخطوات
1 Add file to project
2 Set Action Build=embedded resoruce
3 In code file name= namespace.FileName.FileType
Code:
//read image
System.IO.Stream ms =Assembly.GetAssembly(typeof(Page6)).GetManifestResourceStream("App8.bitmap.png")
//load image
img.Source = ImageSource.FromStream(() = ms);
or
//read file
var tmp = System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Page6)).Assembly;
//file name= Namespace:App8.file name.file type
//
System.IO.Stream s = tmp.GetManifestResourceStream("App8.test.txt");
System.IO.StreamReader sr = new System.IO.StreamReader(s);
//
txtnote.Text = sr.ReadToEnd();
https://docs.microsoft.com/en-us/xama...
Microsoft Visual Studio Professional 2019
#sql #microsoft #net #visualstudio
#WPF #csharp #android #xamarin


Watch video Xamarin Android read text or image files online without registration, duration hours minute second in high quality. This video was added by user Ammar Sharshara 30 January 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,138 once and liked it 18 people.