|
Hi all,
I am developing a c# windows application and creating a setup of it.
When i install that application i want a feature like - when i right click on a file i will get a context menu in which i want to display the application name with the path.
So that when i click on the application some operation will be done on that file.
All this things i want to do it in c#.
Please can any one tell me how can i do it.
Thanks in advance.
|
|
|
|
|
Look for "file type association". It is done in the registry (you can add some registry keys by your setup project). Another possibility is to start the application immediately after install and have it creating the keys, see System File Association[^].
|
|
|
|
|
You need to create a custom action in your setup.
This[^] should give you an idea.
|
|
|
|
|
I am developing a windows desktop application in c# using an MS Access DB in Back end. I am putting some values in DB using MS Acess, the Db is liked to a c# code. Till Exexution everything is fine. But when execution ends the Values disapper from the database which i have inserted before running it. Please Help.
|
|
|
|
|
Are you sure that your program is pointing at the correct DB file?
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Yes there is only on file and i am pointing it only.
|
|
|
|
|
Are you beginning a transaction and not committing it before you exit?
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
yes i tried commiting it too.
|
|
|
|
|
Typically this happens because you added a Access database to your project and, in the Properties for the MDB file, it's tagged Copy Always.
So, every time you run the project, the .MDB file is copied to the BIN folder with your .EXE. Your .EXE then writes new data to the file. The next time you run the project, the MDB file is copied over the top of the file you modified, thereby your data from the last run disappears!
|
|
|
|
|
Hello World!
what I want to do is I want to list every possible combination with alphabet A-Z (only capital) and number 0-9 (Permutations).
I mean something like follow :
C42D5V2DC5V1D23C
AAAAAAAADDD44444
111111111111111A
NNNNNNNNNNNNNNNN
ALL possible modes.
|
|
|
|
|
Well, that seems straightforward enough. The only real issue you have to worry about is whether or not to make the algorithm run in parallel.
|
|
|
|
|
There are 7,958,661,109,946,400,884,391,936 (3616) of these permutations. Are you sure you want them all?
|
|
|
|
|
BobJanova wrote: There are 7,958,661,109,946,400,884,391,936 (3616) of these permutations combinations (with repetitions). Are you sure you want them all?
FTFY. There are 7,307,872,110 permutations.
Greetings - Jacek
|
|
|
|
|
Good point. But that's what the OP actually asked for, I got confused by his mistaken use of the word.
I still get 152,901,072,685,905,223,680,000 for permutations, though (36×35×...22×21).
|
|
|
|
|
Uhhh...what are you doing with this?? You can't store the list because there isn't a hard drive in existance that you can put in your machine that's THAT big. You're talking about a list (not including CRLF characters) of 7.9 trillion trillion bytes!
|
|
|
|
|
jojoba2011 wrote: what I want to do is I want to list every possible...
No you don't.
What you want to do is examine why you think you need that and re-evaluate that need. (The other answers should make it clear that it impossible.)
|
|
|
|
|
"Sarcasm is not welcome" in this forum, so I won't put any sarcasm here.
Greetings - Jacek
|
|
|
|
|
OK, seriously. I have a nasty feature: I like programming at 1 AM. Here is an enumerator which interates through all these combinations:
static void Main(string[] args)
{
foreach (string sperm in new PermutationEnumerator(2))
Console.WriteLine(sperm);
Console.ReadLine();
}
public class PermutationEnumerator : IEnumerator<string>, IEnumerable<string>
{
int stringLength;
char[] table;
char[] chars;
bool go = true;
public PermutationEnumerator(int stringLength)
{
chars = new char[36];
this.stringLength = stringLength;
for (char c = '0'; c <= '9'; c++)
chars[c - '0'] = c;
for (char c = 'A'; c <= 'Z'; c++)
chars[c - 'A' + 10] = c;
Reset();
}
public string Current
{
get
{
if (table == null || !go) return null;
return new string(table);
}
}
bool PlusOne(ref char c)
{
bool overflow = false;
if (c >= '0' && c < '9')
c = (char)(c + 1);
else if (c == '9')
c = 'A';
else if (c >= 'A' && c < 'Z')
c = (char)(c + 1);
else
{
c = '0';
overflow = true;
}
return overflow;
}
public void Dispose()
{
}
object System.Collections.IEnumerator.Current
{
get { return Current; }
}
public bool MoveNext()
{
if (table == null)
{
Init();
return table.Length > 0;
}
int i;
for (i = table.Length - 1; i >= 0; i--)
{
if (!PlusOne(ref table[i]))
break;
}
go = i >= 0;
return go;
}
public void Reset()
{
table = null;
}
void Init()
{
table = new char[stringLength];
for (int i = 0; i < stringLength; i++)
{
table[i] = chars[0];
}
}
void AddOne()
{
for (int i = table.Length - 1; i >= 0; i--)
{
if (!PlusOne(ref table[i]))
break;
}
}
public IEnumerator<string> GetEnumerator()
{
return this;
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
Greetings - Jacek
modified 23-Apr-12 18:41pm.
|
|
|
|
|
I created treeview and webbrowser control.When webbrowser control load website,treeview will buil DOM tree with checkbox node.So,I want press ctrl+mouse click to highlight one element(ex. div, span,...) on webbrowser,then node at treeview will be checked respectively. How can I do handle ctrl+mouse click on webbrowser control??
|
|
|
|
|
|
|
You're welcome.
Thank you for the response.
If you feel that the answer is helpful then you may consider to vote the answer.
|
|
|
|
|
By the way, I have one question.
I want to get data in tag when I ctrl+mouse click on webbrowser, for example
<div>abc...</div>. Then when I press ctrl+mouse click on webbrowser I will get abc...,
so how can I do that?
thanks!
|
|
|
|
|
Hi CodeProject, I'm looking for a C# class to create a GS-1 Databar, but that only ones I have found so far cost $300-1000! I am looking for an open source class which creates one, or a dll which doesn't cost $ and isn't just a limited time trial, since I'm broke.
I have no idea why it's so hard to find one of these, I'll even settle for a tutorial on how to code one myself but not even that I can find.
Please help and don't flame I've tried very hard to find one myself but couldn't.
|
|
|
|
|
No idea - but perhaps this article[^], along with the GS1 spec, will enable you to code one yourself?
|
|
|
|