1
голосов
1ответов
5214 просмотров

C# Dynamically add ToolStripMenueItems to MenuStrip

I was wondering if SO could help simplify some logic. I have a windows form (C# 2.0) which contains a System.Windows.Forms.MenuStrip. I want to dynamically add ToolStripMenueItems to the MenuStrip. The added items will be driven off of a database (but for simplicity I have removed that part...

3
голосов
3ответов
1015 просмотров

2 GB File upload in C#

There is a requirement where the client needs a option to Upload Files that are really large (<=2GB) through browser. And i found that the browser can support only 2GB file upload. Is it so? If yes, then for at least 1.9999GB is there any solution? Tried working with the parameters like ...

0
голосов
1ответов
1572 просмотров

Best method to remove session handled by Session Proxy pattern

I would like to use Proxy pattern for Session handling. In my session proxy class I have something like that: public static class SessionProxy { private const string ThemeNameSessionName = "ThemeName"; private const string PasswordExpirationDaysSessionNam = "PasswordExpirationDays"; ...

1
голосов
1ответов
242 просмотров

How to Upload Multiple files Concurrently in Remoting

I am doing Projects in remoting , i easily send/receive single files from a client.but i don't know how to send multiple files concurrently from a client.can anyone help me with this. please give somelinks i will feed on it.

0
голосов
2ответов
1242 просмотров

Execute remote batch file from within a C# forms application

I am working on a VPN dialer that will execute a login script when the connection is successfull using the following method. Process p = new Process(); try { p.StartInfo.UseShellExecute = true; p.StartInfo.FileName = @"\serverName\NETLOGON\Script T...

3
голосов
7ответов
601 просмотров

Why isn't inlining a method equivalent to declaring it explicitly?

Do you have a blind spot in programming? I mean is there a common technique or language feature that you can't really get used to. Well, I have one (or probably more than one) and mine is usage of delegate. Hands up! Who else doesn't feel comfortable with delegates? Be honest! So what's a del...

0
голосов
4ответов
328 просмотров

Reflection C# question

I am having problem getting values of a class whose one property is another class. Here is an example: public class Person { private int age; private string name; public Person() { Address = new Address(); } public int Age { get { return age; } ...

0
голосов
1ответов
102 просмотров

Reply to specific socket client

I am using C#. I have one socket server in PC A and three socket clients in PC B,PC C,and PC D.When PC A receives data, I want to send this data to either PC B or PC C or PC D. I mean i don't want to send this data to all PC.I just want to send the PC i need to send. Now, when server receives ...

3
голосов
4ответов
2815 просмотров

Adding commas to a decimal number which is in a string of text with .NET 2.0

Greetings. Imagine you've been given a string (from somewhere you can't control). In that string is a decimal number. You want to add commas (ie: turn 1234567.89 into 1,234,567.89) to that number while keeping the entire string intact. The currency symbol before the number will vary, but the ...

5
голосов
4ответов
16727 просмотров

Max DateTime in a list

How do you get the max datetime from a list of DateTime values using C# 2.0?

0
голосов
1ответов
2011 просмотров

Design of Inventory Application(C#)

I would like to design a Inventory system. Some key features listed below. Multi User Multi Branch Support Online and offline Invoicing Multi Currency Language requirements : - C# 2.0 SQL2005 Server I appreciate your valuable suggestions and ideas to design perfect Inventory system. If...

26
голосов
6ответов
93927 просмотров

OnCheckedChanged event handler of asp:checkbox does not fire when checkbox is unchecked

I have a repeater, in each ItemTemplate of the repeater is an asp:checkbox with an OnCheckedChanged event handler set. The checkboxes have the AutoPostBack property set to true. When any of the checkboxes is checked, the event handler fires. When any is unchecked, the event handler does not fire....

0
голосов
1ответов
122 просмотров

I want to get value of an attribute from an XML file

This is the XML file: <?xml version="1.0" encoding="utf-8" ?> <Books> <Book id="1"> <Author>Mark</Author> <Publisher>Sams</Publisher> </Book> </Books> This is the code to extract the attribute: XmlTextReader textRe...

2
голосов
3ответов
494 просмотров

Parsing slightly off-kilter XML in C# with XmlSeralizer

I've been given some "XML" files that don't quite have a proper schema (I think that's the problem) and the medical device that generates them cannot be changed to generate easy-to-parse XML. (With such a tantalizingly small modification (extra wrapping Images tags around the Image entries) it wo...

0
голосов
4ответов
933 просмотров

.NET, and "know" when a keyboard button is being pressed

I'm making a program in C#, And I want to know when the user is pressing\pressed a keyboard button (for now: 1-9 buttons on keyboard). How can I do it?

0
голосов
4ответов
167 просмотров

Encryption API for C#2 recommendations?

We need a paid for supported Encryption / Decryption API for a project - AES>256? I dont want the developers coding their own encryption / decryption even using the built in stuff. To many chances to go wrong. Links to sites much valued. UPDATE Due to the fact as many have said - Its hard ...

10
голосов
3ответов
2936 просмотров

DateTime string parsing

I have made a generic parser for parsing ascii files. When I want to parse dates, I use ParseExact function in DateTime object to parse, but I get problems with the year. The text to parse is i.e. "090812" with the parseExact string "yyMMdd". I'm hoping to get a DateTime object saying "12/8-200...

3
голосов
5ответов
22740 просмотров

ASP.NET : Filter unique rows from Data table

Hi i am using data table in asp.net. I am not able to get how can we filter unique data from data table . Problem is describe below Data Table: Consumer No Date Value ABC001 1st Aug 09 1 ABC001 1st Aug 09 2 ABC001 2nd Aug 09 1 XYZ001 1st Aug 0...

0
голосов
3ответов
1495 просмотров

Replace tokens in an aspx page on load

I have an aspx page that contains regular html, some uicomponents, and multiple tokens of the form {tokenname} . When the page loads, I want to parse the page content and replace these tokens with the correct content. The idea is that there will be multiple template pages using the same codebehi...

2
голосов
2ответов
1396 просмотров

Re-opening a closed NetworkStream?

Good morning, I am in need of some advice, I am using a networkStream, which is streaming from a TcpClient, all was working fine, but then I required the some functionality elsewhere, which requires the stream to be closed. I can't seem to find a way to re open the connection once it has been cl...

5
голосов
4ответов
8955 просмотров

Getting a StringCollection out of AppSettings through the configuration manager

I am accessing my assembly's configuration like this: ExeConfigurationFileMap map = new ExeConfigurationFileMap(); map.ExeConfigFilename = Assembly.GetExecutingAssembly().Location + ".config"; Configuration conf = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);...

0
голосов
3ответов
2056 просмотров

Searching DataTable (c# 2.0)

I know of existence of DataTable.Select(). It works great if you only need to find rows. What if you need to find and modify existing rows? I can't think of any other approach than implementing my own search function. Any input? I am using Compact Framework 2.0, c#

5
голосов
2ответов
2535 просмотров

Sockets, Get Number of Bytes Available (c#)

Good afternoon, OK, short and sweet. I need to get the number of bytes available for read from a socket. I have setup a NetworkStream on my Socket Client but can't seem to find how to get the number of bytes that are available to be read, at the moment I can only get a boolean stating "Yes I ha...

35
голосов
6ответов
20011 просмотров

Speed up File.Exists for non existing network shares

I have to check if a set of file paths represent an existing file. It works fine except when the path contains a network share on a machine that's not on the current network. In this case it takes a pretty long time (30 or 60 seconds) to timeout. Questions Is there a way to shorten the timeou...

3
голосов
4ответов
1828 просмотров

Converting LINQ to .NET 2.0

How should I use this in .NET 2.0 ...? [DataObjectMethod(DataObjectMethodType.Select)] public IEnumerable<OperatorField> FindByType(String type) { // return only selected type return (from ce in this.OperatorFields where ce.Type == type select ce).ToList(); } I use this in a 3.5...

2
голосов
3ответов
603 просмотров

When should or shouldn't I be using generic type constraints?

I've got a base class: public abstract class StuffBase { public abstract void DoSomething(); } And two derived classes public class Stuff1 : StuffBase { public void DoSomething() { Console.WriteLine("Stuff 1 did something cool!"); } public Stuff1() { Co...

0
голосов
2ответов
5234 просмотров

String Split()-method

Why am I getting this error? public class ParameterParser { public List<string> ParseParameter(string queryString) { queryString = queryString.Replace(" ", ""); string[] strs = queryString.Split(@"(", @"=", @",", @"<>", ...

0
голосов
3ответов
1175 просмотров

Multi-threading & db record locks

Need help big time .... I need to create a .net application that will perform some bulk operations on , say around 2,000,000 records, in a table. There is a window of opportunity in which the application should run and try to process as many rows as it can. I am thinking that if I can have mul...

12
голосов
5ответов
11750 просмотров

Restrict multiple instances of an application

Okay, so i've created my c# application, created an installer for it and have it working installed on my machine. The problem is, when the user opens the application exe twice, there will be two instances of the application running. I only ever want one instance of the application to be running ...

2
голосов
3ответов
557 просмотров

How do I control the fetch depth of an eager loading datamapper?

I have a datamapper class that will eager load any property that does not have a Lazy attribute attached to it. I have two entities, State and Country, Country has an inverse relationship to state in that it contains a list of all the states of that country and State has a forward relationship t...