Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
In my project; I have so many json file from web. And inside json file have campaign datas. But that data numbers is always changing. For example in first json it have 5 data and other json have 15. So I need create labels for that datas. For example if in the json file have 5 campaign data , i need create 5. İf it have 10 then i need create 10. Like this. So how can i make it ? I input json files and its works correctly i just need learn how can i create , position N label in xamarin ? Thanks for your help! <3
just create them and add them to some layout container, like this
var stack = new StackLayout();
foreach(var l in LabelData())
{
stack.Children.Add(new Label { Text = l.SomeProperty });
}
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 months ago.
Improve this question
Im trying to edit a postcode data which comes as for example 1234567 and i want to put a dash between 123 and 4567 (e.g 123-4567) is it possible to do this within C# without editing the csv file itself?
Im using a generic for loop to read through the csv file but i want to edit it like i asked above.
foreach(string line in csvData_){
string[] col = line.Split(',');
deliveryAddress.Text = col[0];
deliveryPostcode.Text = col[1];
deliveryPostcode contains 1234567 for e.g.
To solve your problem, you can use the method Insert() of the string object.
For example:
deliveryPostcode.Text = col[1].Length == 7 ? col[1].Insert(3, "-") : col[1];
You have to fit it for your needs, but this is the way I would use.
Here is the MSDN page of the String.Insert().
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am creating a JSON Object.
I want to achieve the below
I would want to make the name of the variable "item_1" dynamic.
So if there 3 items in the loop.
I should create item_1, item_2, item_3 etc
dynamic extension = new JObject();
dynamic item_1 = new JObject();
item_1.id = "00000000-0000-7000-0000-0000000c74c7";
item_1.risk_action = "Bind";
extension.Add(item_1);
How can i achieve the above in a for loop and create variable names dynamically and add it to the main json object
Thanks
C# is strongly typed so you can't create variables dynamically.
One way to solve it, is to use an array, or you could use a dictionary
look at:
https://learn.microsoft.com/de-de/dotnet/api/system.collections.generic.dictionary-2?view=net-5.0
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want to create application in WPF wchich will scrape information from webpage
I read link to the page from text box at the top
I want to extract company name from h6
I don't understand that format:"//h2[#class='card__title mdc-typography--headline6']". I could't find documentation abot meaning # [] etc. to create another filters to scrape other data for example phone number from tag.
The #, //, ... represent abbreviated syntax for XPath selectors.
#abc is short for attribute::abc
// is short for /descendant-or-self::node()/
So, in other terms, your current query //h2[#class='card__title mdc-typography--headline6'] represents the action of finding the first descendant- or self-node that has a class attribute of card__title mdc-typography--headline6.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
What I've got is a text file with some (hypothetical) students and their attendance.
Looks like this:
Stud1
LOOOALLOOAAL
Stud2
OOOOOOOAOOOO
Stud3
LLLLOOOOALLA
So what I want to do, is assign say Stud1 to show Stud1: LOOOALLOOAAL etc etc.
Any ideas?
actually your post is kind of "unclear" to readers but I did get your point regarding reading lines from text to variables
I suggest you use File.ReadAllLines, then format your text with each values separated per line
so it goes like this
Source.txt
LOOOALLOOAAL
OOOOOOOAOOOO
LLLLOOOOALLA
then your line of code will be
string[] students = File.ReadAllLines("Source.txt");
thus the values would be
students[0] = LOOOALLOOAAL
students[1] = OOOOOOOAOOOO
students[2] = LLLLOOOOALLA
the code File.ReadAllLines() gets every line of text from your source file until it reaches the endline and stores it into an array of string. if you needed your values for calculations, then you'll need to parse such values
I just showed you how to get values from text to variables. how you show them as output will be on you.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to write some property item to image. Though I could not do it. But I can edit any currently added property. So I want to know is there are any property item I can use for my purpose? Here are some Id I am getting:
Id:271
type 2
Id:272
type:2
Id:274
type:3
Id:282
type:5
Id:283
type:5
Id:296
type:3
Id:306
type:2
....
etc.
My question is can I use any of the currently present property?
Sounds simple i think
<img id="myimage" data-id="data you want to pass"/>
if you want to add attribute from c# then
ddLedger.Attributes.Add('data-id','yourvalue');
So you want to access this property at backend c# then
string aa=myimage.attributes("data-id");
in string aa you will get your data....
and in jquery
$('#myimage').attr('data-id');
Now if you want to add it at run time then like this
$('#myimage').attr('data-id','your id added');
Demo
Check this url for more details
https://stackoverflow.com/a/1735239/2630817
I hope this will help you....:)