|
Hi guys
I need to write an application in C # that it will auto run when window start up. Need some info and resource on how about creating in? Any example code and sample will be deeply appreciated
Thanks A million
KaKaShi HaTaKe
|
|
|
|
|
You can run pretty much any application at Windows startup by putting a shortcut to the application's executable file in Start Menu - Programs - Startup. You have to check for localization issues (in my Spanish Windows, it's Inicio instead of Startup.)
Environment.GetFolderPath[^] with SpecialFolder.Startup[^] can get you the path to the Startup program group.
I hope this helps!
|
|
|
|
|
also in my application i also need to create an option for user to choose whether they want the option to run on start up... is that any sample code or material i can read about?
KaKaShi HaTaKe
|
|
|
|
|
Depending on your user's choice you should create or delete the shortcut in the location you get with GetFolderPath . I don't have sample code but a Google search on "creating shortcuts C#" should return what you want (as a matter of fact, the first result is a CP article that does exactly what you want.)
|
|
|
|
|
|
Hello,
I am using ReportViewer to generate report. I want my Header to be dislayed in a SubReport.
I am always getting error "SubReport could not be shown".
I am having a class ReportHeader.cs with some properties(UserName, UserDetail etc.). I want this class contents to be displayed in SubReport.
Please tell me step by step, what all i need to do ?
I have gone through so many helps available on net but i am not able to get rid of the error message.
Thanks
Gajesh
|
|
|
|
|
|
setting Format to Custom has worked for me in the past. In fact, I just checked on VS 2k5. If you feel you must then you can set CustomFormat to MM/d/yyyy h:m . Either way, it shouldn't throw any exceptions.
If you're doing this, check the events for the instance of the control to ascertain just where your problem is occurring.
-JC
|
|
|
|
|
THANKS
Have Fun
Never forget it
|
|
|
|
|
Hey all,
The query goes like this...
While browsing the internet on the web browser component,any pop-ups are by default opened on the IE.Is there any way to supress this kind of event and let my own browser open the pop-up?
Thanks in advance....
|
|
|
|
|
Aditya Baraya wrote: Is there any way to supress this kind of event and let my own browser open the pop-up?
It's not your own browser. If it was your code would be parsing the HTML and script and executing the script so yes you could do it. Since it's not "your own browser" then the answer is in the documentation for the browser you are using.
led mike
|
|
|
|
|
There must be some way to do this....
Are you really sure theres no other way to accomplish such a task????
|
|
|
|
|
WOW. Ok that was to a reply from the guy below and he deleted it so it wound up going to you, maybe, if you got it. Anyway.
Aditya Baraya wrote: Are you really sure theres no other way to accomplish such a task????
Not sure what you mean. If there is a way you will have to find it by reading the documentation for the browser control and all it's interfaces, that's all I said in my post.
led mike
|
|
|
|
|
Alrite,but I sadly havent been able to figure out where such a property is exposed....
So if you could tell me about it,I ll be really glad n grateful....
Thanks in Advance.....
|
|
|
|
|
Aditya Baraya wrote: Alrite,but I sadly havent been able to figure out where such a property is exposed
Did you check the article on MSDN about using the popup blocker interfaces?
led mike
|
|
|
|
|
I have declared a Hashtable.
The "Value" field of the hashtable refers to an ArrayList.
The Array List contains a list of objects.
Now how can I refer to a particular object in the arraylist referring to its respective "key" from the hashtable?
To make it clear I'm embedding the code here.
<br />
ArrayList errorlist = new ArrayList();<br />
Hashtable errorstable = new Hashtable();<br />
<br />
error = new Errorcodes(tokens[3].ToString(), tokens[4].ToString());<br />
errorlist.Add(error);<br />
errorstable.Add(tokens[2].ToString(), errorlist);<br />
<br />
<br />
foreach (DictionaryEntry de in errorstable)<br />
{<br />
if (de.Key.ToString() == fetchcodes[4].ToString())<br />
{<br />
string evalue =
SW.WriteLine("\t\t\t" + "public const int ");<br />
break;<br />
}<br />
}<br />
</objectvalue>
|
|
|
|
|
Ravi Mahavrathayajula wrote: Now how can I refer to a particular object in the arraylist referring to its respective "key" from the hashtable?
Have you looked at the documentation for the Hashtable class? If you can't figure it out by reading the documentation then buy a beginners book or take a course at a university.
led mike
|
|
|
|
|
Ravi Mahavrathayajula,
What are you trying to do?, eg: whats the problem your trying to solve. Just because its looks a bit complicated for something as simple as storing a list of "Errorcodes".
Regards,
Gareth.
|
|
|
|
|
Thanks for looking into the problem Gareth.
ErrorCodes is a class as shown below.
<br />
class Errorcodes<br />
{<br />
public string Errorvalue;<br />
public string Errorcomments;<br />
<br />
public Errorcodes(string Errorvalue, string Errorcomments)<br />
{<br />
this.Errorvalue = Errorvalue;<br />
this.Errorcomments = Errorcomments;<br />
}<br />
}<br />
Now I actually need to read 3 fields into a loop, but as hashtables cannot process more than 2, I've read one as key and stored the other 2 fields as objects of the class error codes in a hashtable. Now as I retrieve a "Key" from the hashtable, its respective "Value" field must also be retrieved. But since the Value field in this case is actually an object of ArrayList, I was confused how could I retrieve a particular object that I needed.
|
|
|
|
|
Ravi Mahavrathayajula wrote: I was confused how could I retrieve a particular object that I needed.
You have to cast it from object to ArrayList. NOTE: If you are using .NET 2.0 or higher you should use Generic Containers to avoid the casting.
led mike
|
|
|
|
|
Ravi Mahavrathayajula wrote: but as hashtables cannot process more than 2, I've read one as key and stored the other 2 fields as objects of the class error codes in a hashtable.
Sounds like you should use Collection or List<>. What happen if the key duplicates?
|
|
|
|
|
The "key" is unique and doesn't duplicate in this case. Please correct me know if I misunderstood your question.
|
|
|
|
|
hello
Can i insert a c# code for getting the current date in my code snippet.
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
|
hello
I want to create a code snippet that generate to me the following
//Elie begin : date 12/12/2008 : Fixing ......
//Elie end
i can't generate the date automatically. Plz any help
best regards
dghdfghdfghdfghdgh
|
|
|
|