|
"So I am not sure about the rights."
And whats so hard to test it? Run your app "as adminstrator" and see if this works.
Greetings
Covean
|
|
|
|
|
Why are you doing anything with those folders anyway?? Under Vista and above, you must be more aware of what default permissions users have to the various folders. If you're trying to store data in folders that are not normally used for this purpose, you'll run into permission issues.
|
|
|
|
|
Hello friends,
I had a question.actually I have a web page in which there are multiple buttons.
Whenever I click on a button the contents get displayed in the bellow panel and the color of the button changes.
Then when I click on another button its color changes but the first button color persists.
protected void Button_headers_Click(object sender, EventArgs e)
{
this.Button_headers.BackColor = Color.Blue;
}
So what I want is the color of the button on which I click should change and when I click on second button the first one color should get restored.
I would be very much thankful to you if you help me in this matter.
Regards
Swapnil
|
|
|
|
|
Hi,
write a method to which you pass the button clicked. Call this method from each eventhandler (for a button click).
The method should look like this:
private void SetButtonColor(object sender) {
this.Button_headers.BackColor = (sender.Equals(this.Button_headers) ? Color.Blue : Color.White);
this.MySecondButton.BackColor = (sender.Equals(this.MySecondButton) ? Color.Blue : Color.White);
...
}
Let me know if this helps you.
Regards
Sebastian
|
|
|
|
|
Thanx Sebastian..
Thank you very much..It really worked well..
Really I knew it was not a bug..but Its a great feuture..
thank you very much..
|
|
|
|
|
hi if you don't know the count of buttons you will use write it dynamic
private object lastButton;
private void SetButtonColor(object sender) {
if(lastButton != null && lastButton != sender)
{
lastButton.BackColor = Color.White;
}
sender.BackColor = Color.Blue;
lastButton = sender;
...
}
|
|
|
|
|
Okay, I see from here[^] that there are 3 desktops that come standard with Windows: default, screen-saver, and Winlogon.
The screen-saver and Winlogon desktops are called "secured desktops", meaning they prevent regular programs on the default desktop from being messed with.
Conceptually I get that.
Additionally, it says the "unsecured screen-savers" run on that default desktop, thereby negating your security. Whoopsie. I would hate to create an "unsecured" screen-saver.
From a C# perspective, I've been looking at all the articles on creating screen savers I can find, and not a single dang one of them creates secure mode screen savers. Grah!
So, dear reader, where are the articles I cannot seem to find? I know somebody has done this, but my Google Fu is very weak. Please help.
Narf.
|
|
|
|
|
The screensaver-executable is loaded onto that desktop by default:
Quoted from the sample:
"Before a screensaver appears, Windows creates a new virtual desktop for it. The screensaver process is created on this second desktop, which is never locked. Any other processes that the screensaver creates will inherit this virtual desktop, [...]"
Take a look at the example here[^]. You'd have to scroll down until you find the heading "Secure a Locked Workstation"
I are Troll
|
|
|
|
|
Thank you!
Now I just have to figure it all out for my own stupid screen saver idea.
Narf.
|
|
|
|
|
Uh oh. I followed that whole example, but still couldn't get the interactive "Default" desktop to go away.
After a lot of testing, I had the silly idea to check the "Password protect" check box on the screen saver dialog. Et voila!
The documentation never says that part. It constantly implies that screen savers automatically launch in secure mode unless... they don't. Which is confusing as heck.
At least now I know how the secure mode is created, even if I have no control over the process. It's Windows that decides which context to run it in.
IF it's in secure mode, it does exactly what I want: create a blank desktop showing the current wallpaper and nothing else (save my screen saver form, which I made transparent). That's wonderful.
But I want that to happen whether it's in secure mode or interactive mode.
So I'm going to have to do some more testing on the desktop creation and switching API, which is a headache for a noob, but I suppose it's good learning experience.
Narf.
|
|
|
|
|
Dear all,
I'm a newbie in programming esp using C# in VS 2008 Pro Edition. I'm interested in WLAN location system and part of that is writing programs in C#. Can someone direct me or give me a hint on where to start when writing programs for Signal Strength Acquisition API and Correlation Handler modules plus other modules in Horus location system. Fellow the link for more information http://www.cs.umd.edu/~moustafa/papers/horus_usenix.pdf
Any assistance would be greatly appreciated
Thank you
Cheers,
Willie
|
|
|
|
|
Hi,
at first I would download the api mentioned within the paper. Then check how you can use the API with .NET. (E.g. is it a dll-file, then add it as reference to a project).
Regards
Sebastian
|
|
|
|
|
hi, I am doing a project whereby I would get location coordinates using the GPS, while sending data to the NXT via C# programming.
As i wont be able to get actual coordinates of locations on the map, this project would be a simulation.
Qns 1. What i would like to ask is if i were to use this one data as a reference point, how would i enable the NXT to
1. read this data
2. move to another location
I came up with an idea of converting the time delay between coordinates into distance, but is unable to produce the C# codes of it.
I would be grateful if someone would come up with the codes or another solution.
Qns 2. What if i was to move to another room, how would I create a program such that it will be able to continue to read the data and I only need to change the coordinates
Thanks
|
|
|
|
|
the first ,last,next and Previous record of database table
how could i search?
after succeed connect the database
code...?use dataset? i m a beginner
thanks everyone
|
|
|
|
|
|
Can you post your answer so that it would be useful for others.....
|
|
|
|
|
In this case, that seems doubtful....
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
use BindingManagerBase Class,it can be finished
private void GetBindingManagerBase()
{
/* CustomersToOrders is the RelationName of a DataRelation.
Therefore, the list maintained by the BindingManagerBase is the
list of orders that belong to a specific customer in the
DataTable named Customers, found in DataSet1. */
myBindingManagerBase =
this.BindingContext[DataSet1, "Customers.CustomersToOrders"];
// Adds delegates to the CurrentChanged and PositionChanged events.
myBindingManagerBase.PositionChanged +=
new EventHandler(BindingManagerBase_PositionChanged);
myBindingManagerBase.CurrentChanged +=
new EventHandler(BindingManagerBase_CurrentChanged);
}
private void BindingManagerBase_PositionChanged
(object sender, EventArgs e)
{
// Prints the new Position of the BindingManagerBase.
Console.Write("Position Changed: ");
Console.WriteLine(((BindingManagerBase)sender).Position);
}
private void BindingManagerBase_CurrentChanged
(object sender, EventArgs e)
{
// Prints the new value of the current object.
Console.Write("Current Changed: ");
Console.WriteLine(((BindingManagerBase)sender).Current);
}
private void MoveNext()
{
// Increments the Position property value by one.
myBindingManagerBase.Position += 1;
}
private void MovePrevious()
{
// Decrements the Position property value by one.
myBindingManagerBase.Position -= 1;
}
private void MoveFirst()
{
// Goes to the first row in the list.
myBindingManagerBase.Position = 0;
}
private void MoveLast()
{
// Goes to the last row in the list.
myBindingManagerBase.Position =
myBindingManagerBase.Count - 1;
}
|
|
|
|
|
hi everyone,
i want to create a tree view based on data return from a database.
show the data from database ,but i dnt know which Property of tree view to use
and how could the code be.....
thanks to all
|
|
|
|
|
I believe the treeview has a Nodes collection that you add to. There's no one property that magically works out your data format and turns it into a tree view.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I've got 32 arraylists, each representing one team. I also will have 1696 players, with 53 players assigned to each team. Each player is one array (named by player number) that contains that player's attributes (first name, last name, speed, position, etc). I'm having trouble pointing my main menu to a method that will go through all of these players and send players of particular positions to particular methods to obtain their overall rating. Like, for example, if the player is a CB, that player will be sent to the CBCalculator, obtain his overall rating, input it into the player's array, and then loop to the next player in the list. Also, I'm having trouble setting a rating cap--the maximum attainable overall rating will be 99; anything overall rating that is calculated to be above 99 will be set at 99.
This is what I have so far for the position "sorter":
foreach (Player i in teams)
{
switch (position)
{
case "CB":
CBCalc(int SPD);
break;
case "FS":
FSCalc();
break;
default:
Console.WriteLine("Error 2");
break;
}
This is what I have so far for a test Calculator method:
public static void CBCalc(int SPD)
{
double cbOverall = 28 + ((SPD - 50) / 2.5)
int cbOverall2 = Convert.ToInt32(cbOverall);
if (cbOverall2 >= 99)
{
cbOverall2 == 99;
}
http://i783.photobucket.com/albums/yy112/rooster2154/ProgramLayout_10-29-09.jpg
The above link is to help clarify what i'm trying to do and how the program is set up
If you think you can help me along in my project please add me:
YIM: rooster2154
|
|
|
|
|
Hi,
first some comments on your current code:
1. you have "Player" as a type although your description said a player was an array.
2. the foreach loop won't compile as teams does not contain players, it contains zero or more teams.
3. the first line "CBCalc(int SPD);" won't compile as you don't specify type when calling a method, and SPD is unknown.
I do not particularly like your data organization; the structure is OK, the types are not:
1. each player should be an object, an instance of class Player, and not an array. Inside class Player, you could store whatever data you want to keep for players (first name, last name, day of birth, ...), each using the proper type.
2. assuming each player belongs to a single team, each team should be a List<Player> which is slightly easier to use than an ArrayList. I would be inclined to have a Team class that inherits from List<Player>
3. and then you could have a List<Team> to hold your teams.
So the fundamental organization remains the same, the collections used are different (no arrays and no ArrayLists).
Now to iterate over all players, the code would be:
foreach (Team team in teams) {
foreach (Player player in team) {
... whatever
}
}
public class Player {
string lastName;
DateTime DOB;
...
}
public class Team : List<Player> {
... you don't need much code in here, as you can use all the methods inherited from List,
... e.g. you can do Team.Add(new Player());
}
Hope this helps. If you're unfamiliar with any of this, try reading a book on C#, then come back with specific questions.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
How do I read from a text document while along the way putting selected objects from each line into a particular array? and how would i go about creating a counter so that for each line, the counter is increased by 1 and it automatically creates a new list for that line? (I created a Player class.) Also, how would i tell the it to disregard certain lines that have certain symbols at the beginning?
For example:
* Team 1
* firstName LastName position speed etc...
john jackson CB 88
jack robinson QB 55
* Team 2
* firstName LastName position speed etc...
jim johnson FS 92
etc.
in the first line of text the code will read (disregarding the lines marked with asterisks), "john" will be put in a player's firstName, "Jackson" would be put in that same player's lastName variable, same with position, speed, etc.
i already have some of the code i think i will use ( at http://www.csharp411.com/c-read-text-file-line-by-line/[^] )
|
|
|
|
|
Hi,
1.
you need more structure in your file, how about:
; comments start with this special character (choose one)
; whereas keywords start with another special character (choose one)
; $TEAM is a keyword, it is followed by the team name
$TEAM red
; players are listed: firstName; lastName; ...
Jan;Van den Broeck; CB; 88
Gill;Bates; ZZ; 00
$TEAM blue
...
; end-of-file marker
EOF
FWIW: others will recommend other syntax, maybe an XML file; I tend to keep things simple here.
2.
define Player and Team class as I told before; then use List<T> where T is Player/Team (ArrayList is outdated, arrays are no good, you don't know the dimension).
3.
for small files, you can get all lines at once into memory using File.ReadAllLines()
4.
use foreach to iterate over the lines, then test first char for ; and $
5.
make sure you have a "current team", to which the "current player" gets added.
BTW: I strongly advice you buy and study a book on C#.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|