Can I import a control that I use in visual c#, say for example a dynamic pie chart that spins and updates and is quite graphical, into an ASP.NET web page using code behind files etc. Thanks Jeremy
jblouir
Posts
-
Importing Controls made in Visual C# into ASP.NET -
[Message Deleted]Now if I can only figure out why, and see if there is a method of controlling it. I bet it has something to do with the byte[] array, since there is always 4 numbers. Either that or its the buffer that comes from said length. If its possible to record either one, and then store that instead in memory then I think I might have a workeable solution.
-
[Message Deleted][Message Deleted]
-
Word docsI use the load method that comes from a richtextbox variable, I point it at a word doc, and I choose the plain text option, it loads the text into the richtextbox with a combination of junk and all the actual words in the word doc. I then transfer the text from their in to a string. Its just the matter of getting rid of the junk. Usually all the text in the word doc is tucked away neatly in the middle of the junk, but you get some \\'07 and \par's in their sometimes.
-
Word docsThis is stressing me out. I am trying to read word documents at the moment by loading them in as plain text into a hidden richtextbox, then I take that text and use regex to "attempt" to extract the words from the unicode. I have so far been somewhat unsuccesfull as their is always garble unicode left. Does anyone know any regex expressions that remove unicode from a string? If you are wondering why im doing it in this fasion, it is the fastest way I have found to read word docs. I have tried to use WordApplication classes, and OfficeReaders, and they are either slow or error prone. I thought about using Iwordbreaker, but that skyrocketed over my head and dont know where to begin their, plus you need a license. My c# app is working great now, and its almost ready to go live, its just these bloody word documents. If anyone can help I would greatly appreciate it. Thanks Jeremy
-
Serialized objects [modified]Awesome, thanks for that. Looking in to it now. :o)
-
Serialized objects [modified]Anyone know how to deserialize a file, but not load the whole thing in to memory? Sort of like using a Hashtable, jumping to a point within the file, modifying the data and then closing. Rather than, opening the whole thing up, then rewriting the whole file over and over again. Thanks Jeremy :o) -- modified at 11:45 Tuesday 4th September, 2007 I think I may have found what I been looking for, it appears Memorystream might be what im looking for, anyone have any experience with this?
-
Checking for a keypress in console.If anyone is interested in how this is done. I basically modified it so that it reads the key in the thread inside the loop over and over, and it does things according to whatever the key is. This is just an example. static void Main(string[] args) { object key = new object(); bool stopLoop = false; ConsoleKeyInfo keyInput = new ConsoleKeyInfo(); Thread t1 = new Thread(delegate() { while (keyInput.Key != ConsoleKey.Escape) // repeats the below code until... { keyInput = Console.ReadKey(); // Constantly checks for pressed key if (keyInput.Key == ConsoleKey.UpArrow) // does things depending on key { Console.WriteLine("Up Arrow"); } if (keyInput.Key == ConsoleKey.Escape) // the loop break { lock (key) { stopLoop = true; } } } }); t1.Start(); while (true) { Thread.Sleep(200); // Putting a delay in so it doesnt run at a billion mph Console.Write("01"); // Writing numbers just to visually check the speed lock (key) // This stops the loop if Escape is pressed as defined above. { if (stopLoop == true) break; } } } } }
-
Checking for a keypress in console.Ran into a slight problem. This performs actions within the while without stopping to check for the key but how do you add additional keys? So the loop goes constantly checking for an escape key press, and if it happens it breaks the loop. but what if I want it to perform actions based on other keys while its looping? If you got any info that would be great. =O) -- modified at 16:12 Monday 18th June, 2007 Don't worry again I think I cracked it.
-
Checking for a keypress in console.Nevermind I figured it out on my own, all I had to do was change/add these two lines. ^O^. Thanks! ConsoleKeyInfo keyInput = new ConsoleKeyInfo(); while (Console.ReadKey().Key != ConsoleKey.Escape) ;
-
Checking for a keypress in console.Wow thanks! This is great, but is there anyway to use ConsoleKeyInfo .key ConsoleKey etc instead? Thanks in advance ^0^
-
Checking for a keypress in console.I want to have a loop that checks if a key has been pressed during that time. The loop has a delay of Time.Sleep(25); So the loop starts, check if a key is down then continues with the code, the time delay hits then it repeats. The problem is I can't use ReadKey Read or ReadLine because these all stop the "flow" of the code causing it to physically halt, I want to code(loop) to continue if a key is pressed or not. And System.Windows.Forms; isnt an option as far as I know. Thanks guys.
-
Using your own classes in methods.Ok I solved the problem... For some reason it didnt like the fact that I had the return activeRoom; in the follow position foreach (cRoom room in roomList) { if (room.RID == RID) { activeRoom = room; return activeRoom; } } So I moved it here foreach (cRoom room in roomList) { if (room.RID == RID) { activeRoom = room; } } return activeRoom; and it worked fine I guess I cant have a return value in a foreach loop Thanks for your help. =)
-
Using your own classes in methods.eh woops I think I just figured it out edit: eh nope, still the same thing each room has a number associated to their north south east and west exits if its 0 there is no exit that direction otherwise its 101 or 102 etc. so if activeRoom.NORTH != 0 then its going to == 102 or another number then I take that number and shove it into int RID then I search each cRoom in the arraylist for that value and if it finds it then it takes the rooms value and drops it into the activeRoom and its returned
-
Using your own classes in methods.the variables in my class cRoom are private but they all have public get/set returns I dont see what I am missing
-
Using your own classes in methods.Not all code paths return a value... What code paths is it refering to? code paths in a class or in the method?
-
Delimiters - Is there a simple wayIf you didnt understand his code above. string trimmedFruit = fruit.Replace("\"", ""); its basically a \" in there so every " it finds it replaces it with "" // e.g. null using the \ allows you to put a " in the string text
-
Delimiters - Is there a simple wayYour right, didn't realise. Still learning, on week 1 and a half now. At the point when I was learning how to use regular expressions I must have stumbled on to substring and assumed it was part of the namespace. and I didn't know replace even existed
-
Using your own classes in methods.Thanks! Worked a charm. Its decided to throw another one at me now. 'Adventure.Program.North(Adventure.Program.cRoom, System.Collections.ArrayList)': not all code paths return a value which I am guessing has something to do with the ArrayList im only returning the cRoom object
-
Delimiters - Is there a simple wayusing System.Text.RegularExpressions; // the namespace for using Substring strArray = strLine.Split(new char[] { ',' }; // Use this still, but with the modifications below foreach (string fruit in strArray) // a loop that runs for every piece of fruit in strArray { int fruitlength = fruit.Length; // getting the length of the fruit string fruitlength = fruitlength - 2; // subtracting 2 because of quotes string trimmedfruit = fruit; trimmedfruit = fruit.Substring(1,fruitlength); // basically the method Substring(start,length) // and the first letter starts at 0 and length is how many you want to cut out // so I took the total length of string "apple", subtracted 2 because of quotes // then started the trim at 1 just after the first qoute and pulled out all the letters // minus the qoutes }