| Decompiler.NET reverse engineers your CLS compliant code (137 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| http://www.junglecreatures.com/ Try it and tell me what's happenning in the Microsoft Corporation. Notes: VB, C# are CLS compliant You can also use managed code with C Using what they call obfuscator, will not help you for a long time. For each new obfuscator there will allways exist a new deobfuscator. Your source's Symbols are written unchanged in the exe or dll file. Looking to your Symbols, it... |
|
| Response.Write for a XML string (13 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| All, I have a well form block of XML that is stored in a C# string type and I just simply want to display it in the browser using Response.Write but when I try this I get the following error: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. Cannot have a DOCTYPE declaration outside of a pro... |
|
| Struct Vs Classes (12 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi Gurus, In C# why struct can't be inherited from another struct, just like a class can be inherited from another class? another question is all struct by default are inherited from System.Object class, how this is possible when it is not allowed to derive a struct from a class? and System.Object is the reference type provided by the .NET Framework then why structs are value types? since the stru... |
|
| Is it possible to embed a zipped text file, then unzip or read from it at runtime? (10 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| pardon my ignorance as I am a self taught hobbyist programmer. I am curious after reading up on SharpZipLib. Can I embed a zipped txt file in my program? Then either read from within the zip file or unzip and read it? I currently have an embedded text file that contains a list that is read into an array. I'm always looking to save space. And I could reduce my file size 75% if it was zipped! I have... |
|
| Declaring a Constructor in an Interface? (20 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I am accessing my database through an interface, to allow future substitution of the physical datastore hence I would like to declare in my Interface that my DAL objects implementing the interface and accessing the datastore MUST pass in a UserToken in the constructor of the object. Is this not possible? Am I forced to add the UserToken as a property on the object instead? /Ole |
|
| HELP: Late Construction via Reflection & instance variable initializers (10 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi All, I not sure if I am doing something wrong, or if this is a bug in the framework somewhere but I'm having trouble with instance variable initialization which is done before any of the ctors are called. Very simple code follows! Any help much appreciated! Given this class: public class Wibble { public int var1 /* 0*/; //Intentionally left at 'default' public int var2 0; public Wibble(){} } Th... |
|
| CheckBox CheckChanged EventHandler not working? (10 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I have a login page with two checkboxes, one for automatic login and the other for remember username. When automatic login is checked, I simply want the remember username checkbox to be checked too, but the eventhandler is NEVER executed. do i need to create a different type of event handler? Here is my code: CheckBox cb new CheckBox(); cb.ID "myCheckBox"; cb.Text "Remember Username"; cb.CheckedCh... |
|
| Remoting and calling functions in another class (6 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| What I want to do is call a function in my main form/class from the server (which the another program/client calls). The main form does not really create a server object so I can't pass the frmForm class into the constructor of MyServer (the client side would have no idea what to pass into that anyways). What other way to do this is there? I guess there is static functions, but I can't make everyt... |
|
| Multi-selection datagrid rows (6 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| hello, i'm using a dataview to filter my table. how can i get a index (for the original table) of the selected rows (there can be more than 1). please help |
|
| Fastest way to access data from a file. (10 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi. I'm developing a desktop application that needs to store some data in a local file. Let's say for example that I want to have an address book with names and phone numbers in a file. I would like to be able to retrieve the name by searching for a given phone number the fastest I can. I have considered the posibility of using XmlTextReader with something like: list item number "1234567" name Joh... |
|
| other table that stores data differently than ADO.Net datatable? (10 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the system since all this data will be stored in memory. The performance is really affected with this. Since we don't really want to redesign everything based on this datatable, are there any companies that... |
|
| pull text from a web site (6 replies) |
| microsoft.public.dotnet.languages.csharp |
| Using the code below, I can pull the text from a file and store it in a string. I'd like to be able to do the same thing with a web site ... perhaps www.cnn.com. How can you do this? StreamReader objStreamReader File.OpenText("c:\somefile\blah.txt"); //Replacing this with a URL errors out. string strMyString objStreamReader.ReadToEnd(); objStreamReader.Close(); Thanks in advance. Mark |
|
| C# eq of C++ typedef (7 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi. Is there any way to define an alias for a type like you could in C : typedef int NUMBER; I tried using #define but that did not work. Thank you. Regards, Dennis JD Myrén Oslo Kodebureau |
|
| Debugging a c# serviced component (9 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| All, I have a C# library serviced component that I am trying to debug from a ASP.Net page. The C# has the following attributes: namespace yyyyyy [assembly: ApplicationAccessControl(false)] [assembly: Guid("860015D5 B182 4681 90D2 18C1CFFE8EE3")] [assembly: ApplicationName("xxxxxx")] [assembly: ApplicationID("88976ED4 61AF 4deb 9023 A81595B5780A")] [assembly: ApplicationActivation(ActivationOption.... |
|
| pass byte-array by reference from c# to managed c++ (17 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| hello, I'm allocating a byte Array in C# with byte[] byteArray new byte[5000]; Now I want to pass this byte Array to a managed C function by reference, so that I'm able to change the content of the byteArray and afterwards see the changes in C#. (if you wanna know more details: the goal is to write the content of an existing char array in c precisely into the passed byteArray, so that after the fu... |
|
| Events and delegates (7 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| NOTE: I'm new to c#, but not to programming. For reasons unimportant to the discussion below, I need to be able to dynamically, at run time, discover the set of all objects listening to another object's events. Given some jRandomType, I've figured out how to get the Events themselves via reflection and GetEvents/EventInfo. This will give me a list of the Events that jRandomType wants to raise but ... |
|
| OnUnload event (6 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, Iwould like to do that. Is it possible because I can't do it? in test.aspx file: body onunload "signout()" in test aspx.cs : void private signout() { HttpContext.Current.Cache.Remove(Session["usrName"].ToString()); Session["user"] null; Session["usrName"] null; FormsAuthentication.SignOut(); } Is it possible to use C# function in onunload event. Please could you tell me hoe to implement this. ... |
|
| Difference in && and &= (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| Run this method: public void test() { bool b; int i 0; b false; i 0; b (b && i 1); Console.WriteLine(i.ToString()); b false; i 0; b& i 1; Console.WriteLine(i.ToString()); } Notice how in the first syntax, i is NOT evaluated (because of short circuit evaluation) but in the second syntax i is evaluated. I wonder if this was intentional or an oversight. It burned me in a situation when I was counting... |
|
| Searching in a dataset (6 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, I don't know how I can search in a dataset. I can trace the table by DataRow and foreach loop. but you may know a better way. I have a datagrid and a textbox. when user type a string in textbox, I need to search in datagird and change the current record to the found record. thanks |
|
| timer too slow... why? (14 replies) |
| microsoft.public.dotnet.languages.csharp |
| I've create a "stupid" animation. A simple label that bounce on borders of my form. Motion is ruled by a timer that set the timing of every steps. If I set the interval at "1000" it works properly, howevery if i set it at "10" or less, it warks slower than it would be. Anyone can help me? Excuse my bad english Thanks Diego (Atos) L'uomo è superiore agli animali Fanno eccezione il nano e la giraffa... |
|
| Need .Net Design Help (8 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I've got a fairly simple application implementation that over time is going to get a lot bigger. I'm really trying to implement it in a way that will facilitate the growth. I am first writing a WinForms interface and then need to port that to a web app. I am kinda stuck on a design issue and need some suggestions / direction. Basically I have a business layer that I want to use to process any data... |
|
| CrystalDecisions.CrystalReports.Engine.LoadSaveReportException when OpenSubreport() was called (5 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi everyone, I have a Crystal Report with a subreport in a windows application, which is to be exported to the pdf file. I followed the instructions on http://support.crystaldecisions.com/library/kbase/articles/c2010275.asp to set up the log on information. But I always got the exception at the statement: tbl.Location ...; The error message is listed below: An unhandled exception of type 'CrystalD... |
|
| Passing an Enumeration Variable by Ref (7 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I have MyEnumeratedSet { ... some values go here ... } I have a variable that is defined as MyEnumeratedSet MyVariable; I have a function that needs to be able to set a variable by Ref MyFunction(ref System.Enum Parameter) { ..... Parameter has to be set here } so I have tried calling it by MyFunction(ref (Enum) MyVariable); unfortunately this yields compiler errors and it seems like there is no w... |
|
| reading text into arrays (9 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I am working in C# visual studio. Right now I have managed to read in a text file to an arraylist and write it to the console screen. What I would like to do is convert this to a one dimensional array and write it to a new file. My code is as below. The first chunk of it works, but when I try to create the array, it writes System.String [] in the console. Thanks using System; using System.IO; usin... |
|
| Update table using bound text box (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi, I'm trying to update a sql database from a web form using text boxes. I'm trying to learn C# on my own so I am at a complete loss. I created my sql connection, data adapter, dataset and data view in the visual studio designer. I'm trying to keep a history of the record so instead of editing the record I insert a new record with my changes. Instead of the changes, it inserts the orginal record.... |
|
| Obtain Unicode value from Character Code? (9 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I have a situation where I have a series of character codes stored in the database. In some cases they are the ASCII value of the character, in other cases they are the 127 character code value that you use in combination with the ALT key to enter special characters into a document (e.g. ALT 0147 and ALT 0148 get you 'smart quotes'). I'm trying to figure out how (or if it's possible) to obtain the... |
|
| whileloop in winform cause app to crash ! why ? (9 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hello friends, for some reason when I execute this piece of code in a winform it immediately crashes the app. baseically I'm trying to manage a thread pool for a client/server based app. while(true) { while (!client.Pending()) { Thread.Sleep(1000); } ConnectionThread newconnection new ConnectionThread(); newconnection.threadListener this.client; ThreadPool.QueueUserWorkItem(new WaitCallback(newcon... |
|
| deleting file - access denied (7 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi all! I created a webservice that check folder for incoming and outgoing files. If a file exists in my inbox (incoming file) I read it and want to delete it. It looks like this: foreach(FileInfo fname in folder.GetFiles()) { if(fname.Exists) { myStream new StreamReader(fname.FullName,Encoding.Default); string line myStream.ReadLine(); while(line ! null) { content line; line myStream.ReadLine(); ... |
|
| Does lock the entire object? (6 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hello, I've read conflicting posts about [MethodImpl(MethodImplOptions.Synchronized)]. Does it or does it not lock the entire object? In my simple test it appears to block just the method but I wouldn't exactly call my meager test conclusive... thanks, Scott |
|
| Asynchronous Delegate w/ Callback Parameters (5 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi all, Is there an easy way to get the parameters of an asynchronous delegate call from the callback function? Here's an example of what I'm trying to do: private delegate ArrayList AsyncDelegate (string server); private void GetServerInfo (string server) { AsyncDelegate ad new AsyncDelegate(GetServerArray); IAsyncResult iar ad.BeginInvoke(server, new AsyncCallback(EndGetServerInfo), ad); } priva... |
|
| Configuration files for Services and Class Libraries (4 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with applications and web services without having to use the machine.config file. I know that I could use the code below to do this but the problem then becomes that when using a shared assembly both the assembly... |
|
| How to create class instance automatically in C# (8 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hello everyone! I have a problem about create an instance automatically in C#. Now I have a class: namespace1.namespace11.CClass01. I want to create it's instance in a function named CreateObjInstance. And the function not only generate just CClass01. So I must sent the class type(whit it's namespace) into the function. There has two question following. The first is I can't send a class type into ... |
|
| 32K limit in TextBox ?! (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| I'm writing an application with a TextBox control on its main form. I'm running the application under WinXP Pro, so (as I understand it) there should be no practical limit to the number of characters in a text box. However, when I paste in a large amount of text, the text box truncates it at exactly 32K characters. This is a problem, because I need to know exactly how many of each character were p... |
|
| DataGridBoolColumn (4 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi, my code is: myDataTBL.Columns.Add("checked",System.Type.GetType("System.Boolean")); DataGridBoolColumn cs1 new DataGridBoolColumn(); cs1.NullValue false; cs1.TrueValue true; cs1.FalseValue false; cs1.MappingName "checked"; cs1.ReadOnly false; dataGrid1.TableStyles[0].GridColumnStyles.Add(cs1); what i get is always a gray checkbox. When i click it, it becomes checked, and another click turns it... |
|
| IEnumerable interface (4 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| A class correctly implementing the IEnumerable interface can be bound to a DataGrid or similar. Let's say you have a class called Person, and it has fields like FirstName, LastName and DateOfBirth, which are exposed as public properties. You create a strongly typed collection class of Person objects that implements the IEnumerable interface. When you bind the collection class implementing IEnumera... |
|
| SortedList case-insensitive key comparisons (4 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi all, I'm using a SortedList to store data, and want the keys to be compared in case insensitive order, so that mySList["a"] is the same as mySList["A"] I've run across the IComparable interface, but not sure how to implement. Anyone know where I can find more info and samples? Thanks, Michael C., MCDBA |
|
| File.Exists question (10 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I have code like the following to test for existence of a file. I know the file is there, but File.Exists returns FALSE. The problem appears to be that the file is in a directory beneath "My Documents". When I move it to a directory directly under the root, File.Exists returns TRUE. So I tried using FileIOPermission to give me rights to read it, but still no luck. Any suggestions? Thanks... FileIO... |
|
| problem with text in DataGrid (4 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi, I use dataGrid to show data from DataBase. In one table I've text field (varchar 2048) and data in this field is very long (more characters). How show this text in datagrid as multiline or which component use to show multiline date. Thx PawelR |
|
| parseing an xml string (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| I have an xml document loaded into a string that I need to parse. below is the first few elements in the xml string. ?xml version "1.0" standalone "yes"? xs:schema id "NewDataSet" xmlns "" xmlns:xs "http://www.w3.org/2001/XMLSchema" xmlns:msdata "urn:schemas microsoft com:xml msdata" xs:element name "NewDataSet" msdata:IsDataSet "true" xs:complexType xs:choice minOccurs "0" maxOccurs "unbounded" x... |
|
| What's wrong with this regular expression? (8 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi, I have a Regular Expression like this: string s1 Regex.Replace("BA","A",@"C$&"); I assume that s1 will be "BC$&", however the real rusult is "BCA". Is this a bug or my Replace method is wrong? I am using .NET Framework 1.0. Thanks! |
|
| How big can XML file be? (11 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi there, I have a quick question. I want to store all my data in XML file so that I don't need to depend on database backend. But I wonder how big can my XML file be? I don't mind to span the data into multiple file but I less I know the limitation first. Cheers, Kids |
|
| streamwriter (5 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Can one streamwriter object create dynamic files? in nested if statement? example of code |
|
| Function Help (5 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi, I have a vacation database with a calendar table to hold all the public holidays and weekends. I need a c# function which I pass in the vacation start and end dates and I require it to return the duration. Here is my code but I canâ t see whatâ s wrong. public int Duration(DateTime Start, DateTime End) { string sqlCmd "SELECT COUNT(dtmDate) FROM tblCalendar WHERE (blnWeekday 1) AND (blnHoliday... |
|
| XML Question (3 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi all, I'm playing around with an XML structured like this: root subone setting name "xyz" value "100" / /subone subtwo list name "abcde" value "1000" / list name "fghij" value "2000" / /subtwo /root I'm trying to figure out the most efficient way to read the attributes of subone child nodes into one array and subtwo child nodes into another array? Any ideas are welcome. Thanks in advance, Michae... |
|
| Delegates and Event to replace with Interface? (4 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi there, I just read Chris Sells's article at http://www.codeproject.com/csharp/delegate bedtime.asp?df 100&forumid 2983&select 922269#xx922269xx I wonder i can do this: 1) I want to built in a class library that had multithreading enabled. My initial overview of the library: interface IParent { void funcA(); } class Parent : IParent { // used this to be extended by other ppl in future } interfac... |
|
| so I have a byte, how to copy to int, string, etc.. (7 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I'm trying to write a quick migrate tool to convert our old binary flat DB to SQL Server. I thought I would use C# and get started with a managed language. I have found plenty of examples of how to read a binary file into an array of bytes, great. But what do I do with it then? How can I copy n bytes from my data byte[] into the new, managed float object that I just declared? What am I missing? An... |
|
| What is the best way to update UI from different thread? (3 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| Hi, I have an application which run 3 different thread. the main application display a window like a console window in VS.NET. I would like that each thread will write to this window details about it's progress and status. I wonder what to choose 1.BeginInvoke. 2.Invoke will halt the calling thread isn't it? 3.Writing to a thread safe queue,use another thread to read from the queue and output it i... |
|
| Code dom and Attributes (3 replies, VIP) |
| microsoft.public.dotnet.languages.csharp |
| I need to add some attributes and look at existing attributes to a property. Not the private/public stuff, but rather something like: System.Xml.Serialization.XmlElementAttribute What should I look at for doing this? Thanks Wayne |
|
| Static inheritence (5 replies) |
| microsoft.public.dotnet.languages.csharp |
| Hi. Considering the following code, I want this call: Something.Method(); To return "Something". public class BaseClass { public static string Method() { return type where the method was called .Name; } } public class Something : BaseClass { } The code illustrates the problem, but in real life I won't return the name of the Something type, but rather use the Something type in my implementation in ... |
|
| Extracting String Info from WebRequest Cookie (12 replies) |
| microsoft.public.dotnet.languages.csharp |
| Dear C#dex, I define a variable: HttpWebRequest webRequest and run the following request webRequest WebRequest.Create(TARGET URL) as HttpWebRequest; The webRequest object returns values and in the debugger I can see the value I want in the property webRequest. ChallengedUri.AbsoluteUri; However that property is protected and not available outside of the debugger. Does anyone have a suggestion how ... |
|