0
votes
1answer
12 views

Populating a Dictionary with PdfOutlines

So I am attempting to write a program that combines a PDF from a list of PDF's that are already available. I've got most of it done to this point, but I'm having an issue with one step in particular. ...
0
votes
5answers
110 views

C# Loop Through An Array

I am completely new to C#. I am trying to loop through a short array, where the string elements in the array are placed at the end of a website search. The code: int n = 1; string[] s = ...
1
vote
9answers
64 views

Why does this byte[] not equal my other byte[] with the same values?

public static readonly byte[] TestArray= new byte[] { 0x75, 0xa5, 0x15, 0x19, 0xa0, 0x2e, 0xd9, 0x37, 0xb0, 0x4d }; public bool TestFunction() { MemoryStream s=new MemoryStream( new ...
0
votes
1answer
37 views

override default new operator for an array of a class C#

I am using pinvokes to call native code. if I want to create an array of the native objects I currently do the following public class MyClass() { // allocate a single myClass; public ...
-1
votes
1answer
18 views

Dequeueing an class and individual values c#

This is a follow up from yesterday's question I have 2 queue, they contain 5 elements each called player 1 and player 2. They were queued using something like the following ...
4
votes
8answers
130 views

How to Convert int[] to int[,] - C# [closed]

It look simple, yet I just can't' wrap my head round the logic. I have an int array in this form {1,2,3,4,5,6} and I want to convert it into this form {{1,2}, {3,4}, {5,6}} How do I achieve this ...
0
votes
0answers
41 views

printing out different outputs for each value in an array c#

Hi I currently have a array that has all the values of a text file in it and currently have it reading back the file when it runs but I want to produce outputs for each value in the array when it ...
4
votes
5answers
82 views

giving a class object a value c#

I have a class called playingcards it inherits from a cards class. I instantiated it as an object called chuckcards. One of the data members is CARD ID. I'm trying to assign a int to the value. it is ...
1
vote
6answers
81 views

Array Index selection C#

I have a array of length 300 of type int. Most of the element is 0 and I want to get the index of the first element that is greater than 0. How can I achieve this. Thank you
0
votes
1answer
29 views

Creating a method that prints different outputs for each value in array c#

Hi I currently have a array that has all the values of a text file in it and currently have it reading back the file when it runs but I want to produce outputs for each value in the array when it ...
6
votes
4answers
112 views

A workaround for a big multidimensional array (Jagged Array) C#?

I'm trying to initialize an array in three dimension to load a voxel world. The total size of the map should be (2048/1024/2048). I tried to initialize an jagged array of "int" but I throw a memory ...
0
votes
1answer
36 views

Skype API System.IndexOutOfRangeException C#

So there's a program i saw, coded in c#. I keep getting errors on it. System.IndexOutOfRangeException is the main one, its happening at "args[0]". This is the code: using System; using ...
0
votes
1answer
50 views

Extract a string array from an object in c#

It's been a while since I studied programming and I'm struggling with this. I receive from a web service a bunch of info, which I save on an object, then after using the reflection method I get ...
-5
votes
1answer
41 views

Convert a Text File into a CSV File with C#

I have a txt file that is Tab Delimited, like this: Well Name Detector Task Quantity 1 try1 Cam1 UNKN 0 2 try2 Cam1 UNKN 0 3 ...
1
vote
1answer
24 views

NUnit Sequential Attribute with arrays in Values

How I can pass string[][] arrays to ValuesAttribute? I have: public string[][] Array1 = new[] {new[] {"test1", "test2"}}; //... [Test, Sequential] public void SomeTest( [Values("val1", "val2", ...
0
votes
0answers
19 views

Draw Rectangle save to rectangles array with Attributes

I need to draw a rectangle on a C# winform picturebox. When rectangle is drawn I need to save the rectangle to a rectangles array. Needs to also be able to store meta data with the rectangle like ...
3
votes
3answers
56 views

Behavior when set two multidimensional arrays equal

I'm currently programming a Tetris application. I'm using a multidimensional integer array for my stones, which represent their position on the multidimensional Panel field (int[row][colum]). I'm now ...
-2
votes
1answer
50 views

reading from txt and adding read info to different variables

It's a pretty simple problem, I am creating game with C#(XNA) and I have a TXT file containing: 7 3 1,2,3,4,5,6,7,8,9,10 I need the first two numbers added to two variables or one array. And of ...
0
votes
0answers
18 views

Pass Array in HTTP Post Request

I am trying to make POST request but Every Time I get error. Body of my post request is as below : Content-Disposition:form-data; name="request"; { "recipients":["7778888"] } So I ...
-1
votes
1answer
79 views

C# simple form index was outside the bounds of the array

I'm a student of programming and decided to make a simple program to practice. It's a simple form, with name, date of birth, address etc, and it's being saved in a text file (I know there are easier ...
0
votes
1answer
39 views

c# Removing an object from list based on 2 variables

I'm trying to remove an object from a list, First I need to get all the entries in it with the id == 0(for now) and then remove the first entry. At the moment I'm trying: coursework.Where( x => ...
-2
votes
2answers
66 views

C# Struct array [closed]

I have this project which I am working on, and I need help on C# structs. I am using a Console application. What I'm after is to create a struct that I can use in a array. What I have so far is: ...
0
votes
3answers
48 views

c# finding items from a list with linq to an array

Just wondering how would I get something like this to work? void EditListUpdate(int id) { string[] editListMod = modules.Where(x => x.Id == id).ToArray(); } Modules is a list.
0
votes
3answers
24 views

Event action of a specific label from an array of labels c#

I am working with an array of labels and I don't really know how to add a click action to all of them. For example if the user clicks on arrow[i] that arrow should display something. I've also ...
1
vote
2answers
39 views

Getting a variable from a list of objects

How would you get a variable from each object in a list? I've got this so far: void SortList() { int j = modules.Count; string[] titles = new string[j]; for (int i = 0; i > ...
1
vote
4answers
56 views

Checking for null array element in advance

If I am checking the contents of an array using: boardArray[xIn][yIn] and I am expecting there to be an element, how do I check if there is no element / object there in advance? Really silly ...
0
votes
1answer
38 views

How to dynamically create objects from a file?

I'm reading in files such as this with multiple lines like this. "title,name,something,something,something" How would I dynamically create new objects with those variables I am splitting it already ...
0
votes
6answers
51 views

Merging Arrays or Appending to an array

In C# I have three arrays, string[] array1, 2 and 3 and they all have differnt values. I would love to do what I can do in php which is: $array = array(); $array[] .= 'some value'; Whats the ...
-5
votes
2answers
96 views

Having trouble with arrays and constructors [closed]

I think I'm missing something very small. I also think I've written probably 95% of the code needed to succeed. The problem is that when I run the program my output is always 0 for each answer. In ...
1
vote
6answers
41 views

Declaring an Array of Textboxes

I'm trying to declare the array Scores as an array of textboxes. It doesn't have a size. I also need to declare it as an instance variable, and instantiate it in the method, CreateTextBoxes. I keep ...
0
votes
3answers
39 views

Parse through an array of strings to check how many times there's a value

Say I have this array of strings: string[] arrayToParse = {2, G, R, G, B}; I need to parse through the array to check how many times is a string present so that I may end up with values like this: ...
0
votes
2answers
47 views

Not displaying string array with particular loop iterated index

I am trying to make a simple number to english words program and I've decided to use arrays. Its not displaying the loop iteration values in tens2 array, as i have declared it in string array. what ...
3
votes
1answer
55 views

create AudioClip from byte[]

I have problem. I use sqlite to store sounds. I get sound from it in byte[]. Then convert byte[] to float[]: private float[] ConvertByteToFloat(byte[] array) { ...
-2
votes
3answers
97 views

How to convert decimal array to string array in C#?

i need to convert Decimal array to string array . How to convert decimal[] to string[] ? Can i use Array.ConvertAll() method to do this task?
-1
votes
2answers
74 views

C# Nullable arrays

I have a search function, but I would like LocationID to be an array of integers rather than just a single integer. I'm not sure how to do this since I want it to also be nullable. I've looked at ...
0
votes
2answers
64 views

Comparing user input to previously entered values

I am having a problem getting my program to check the input previous and compare it so the user cannot duplicate an order number. Right now the program will run all the way through and look the way I ...
-1
votes
3answers
73 views

Assigning each field of an array to a variable, foreach loop

I have a string array, and a for each loop. I want to loop through the array and do something to each field and then output the result of each field to a new variable. EDIT: Each field of the array ...
2
votes
3answers
44 views

Creating variable sized arrays

I have been creating arrays for different controls as follows, e.g: private TextBox[] Array_TextBoxes; private CheckBox[] Array_CheckBoxes; private RadioButtonList[] Array_radioButton; ...
0
votes
2answers
84 views

Preventing duplicate numbers and asking for user to reenter

Everything I have runs fine, but I am looking for a way to prompt the user if duplicate order number is entered and have them reenter a new order number. Right now it just accepts duplicates and does ...
1
vote
2answers
60 views

Get all sub arrays of a particular length in an array

I want help with getting the subsets of an array in C#. All other examples could not help me much. I want to get all the subsets of a particular size of an array. for example if input array is ...
0
votes
3answers
66 views

Array memory c# (copied to new reference or using the same?)

So I couldn't seem to figure this out. In the following code: int[] array1 = { 86, 66, 76, 92, 95, 88 }; int[] array2 = new int[6]; array2 = array1; When array2 is "copying" the values of array1, ...
1
vote
2answers
45 views

Split string and remove spaces without .select

(Limitations: System; ONLY) I want to be able to split a string into an array and remove the spaces, I have this currently: string[] split = converText.Split(',').Select(p => p.Trim()).ToArray(); ...
0
votes
3answers
86 views

Split file line by line into an array

I want to have an array based on the lines in the file, but at the moment its a fixed sized array: string[] converList = new string[6]; // Array containing TXT lines Reading the file: void ...
0
votes
2answers
52 views

Find string in an array based on first word

I'm trying to filter out an array based on 2 keywords that must be in order, So far i've got this: string[] matchedOne = Array.FindAll(converList, s => s.Contains(split[1])); string[] matchedTwo ...
0
votes
3answers
48 views

Concatenate 2 or more arrays into unique combinations in new list

I am working on a problem where I have can have 2 or more arrays of string values. Starting with the first array, I need to take each value and concatenate the first value of the next array and the ...
1
vote
5answers
133 views

skip value in for loop if it = 0 c#

how to skip writing the value to the file if it = 0 in my calculator program Procedure that writes the array into a file public void SaveArrayToFile() { int count; ...
0
votes
2answers
36 views

Reference not set error at empty line

I get this error when I read from a file and the file has an empty line, I want the loop to stop at the empty line but I get this error, how should I do this? string[] delim = new string[] { "," }; ...
11
votes
1answer
168 views

slow performance of multidimensional array initialiser

I have some weird performance results that I cannot quite explain. It seems that this line d = new double[4, 4]{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, ...
1
vote
1answer
45 views

How to pass a 3D array to a SQL Server stored procedure

I have a 3D string array in C# and I need to send it to a SQL server stored procedure as a parameter so that the procedure performs a select query using WHERE condition from each array row (3 ...
0
votes
3answers
64 views

Find a value in an array from row and column index

So I have a 5 by 6 two dimensional array(A). From this array(A) i would like to return a value based on the input of row and column by the user. What I have so far... private int FindValue(int[,] A, ...

1 2 3 4 5 66
15 30 50 per page