|
I know how to change and update values stored within the Properties.Settings.Default that are user based. I know these values are stored under the Windows User Name that is currently logged in. Is there a way to change this so the user 123456 that is logged in can change change the values under user 654321?
Chris
|
|
|
|
|
I seem to remember vaguely something about the difference between user settings and application settings. It sounds like you are attempting to use the latter. See this[^] article on application/user settings, and let me know if it is what you are looking for.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
This is want I would like to do.....
The is 1 computer that about 10 different people use. There is a default user login to get to the windows desktop. From there they run my application and sign into my application using their IDs. I would like to create or change the Properties.Settings.Default to use for who logs into my application and NOT the default windows login.
|
|
|
|
|
Well, given that definition, you only have two choices...
1. Use application settings, but have a different section for each application user
2. Create your own setting schema and implement that schema from scratch.
As far as I know, you cannot change the user settings file to apply to your application user... it always uses the windows user. I would recommend the first option as it is easier (IMO), and simply log a different section for each user in the app settings. Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I have a listview named redTagView.. I'd like to color the 4th column red or green depending on if it's an "N" or not. I've written the following code..
for (int i = 0; i < redTagView.Items.Count; i++)
{
if (redTagView.Items[i].SubItems[3].Text == "N")
{
redTagView.Items[i].SubItems[3].ForeColor = System.Drawing.Color.Red;
}
else
{
redTagView.Items[i].SubItems[3].ForeColor = System.Drawing.Color.Green;
}
}
The code sits there and stares at me like I'm an idiot. Makes me feel warm and fuzzy inside. Any reason why this shouldn't work? Tried redTagView.Refresh().. nothing.
|
|
|
|
|
Hi,
you can use :
listView1.Items[i].SubItems[0].BackColor = System.Drawing.Color.Red;
And this must be false, else the total area of the line is in the same color.
listView1.FullRowSelect = false;
Greetings
Cola 1973
|
|
|
|
|
Hi,
Just looking for some advice as I think my current working solution is probably wrong. I've written a small video player in C# using ffmpeg as the decoder and a thread to process and display the footage. However, as I try and further the player's development the thread idea seems more difficult to control. My main window initialises the video footage but plays its output in a seperate thread to a seperate window. To pause the video I suspend and resume the thread, this works fine. To stop the video I abort the thread and kill the seperate window, I can then initialise another video and then play it fine. If, however the video plays to the end I can't restart the player as the previous thread doesn't seem to have terminated properly. Is it possible to control threads where they can be stopped and restarted.
Thanks in advance.
|
|
|
|
|
paul9038 wrote: To stop the video I abort the thread and kill the seperate window
paul9038 wrote: Is it possible to control threads where they can be stopped and restarted.
I imagine so. I have never implemented an approach that aborts threads since virtually all the documentation you read warns against aborting threads. You should use thread communications techniques to control the operations of the thread internally. The result is that the code executing in the thread has an alternate path that causes the thread procedure to return which ends the thread in a proper controlled fashion.
public static void ThreadProcedure(...)
{
while ( IShouldContinuePlayingRecording() )
PlayRecording();
}
So to cause a thread to end looks like this:
1) parent thread communicates with child thread telling it to end
2) child thread receives the message and alters it's flow of control resulting in the thread procedure returning.
is that what you were asking?
|
|
|
|
|
paul9038 wrote: If, however the video plays to the end I can't restart the player as the previous thread doesn't seem to have terminated properly.
This should provide some clue as to what's going on. First, you should allow the thread to exit if playback completes (I can infer that you're doing this, I'm just making sure). While you could probably manage to keep the thread alive and consume new playback requests, it is probably much easier to simply let the thread exit and create a new thread when you want to start a new playback.
With that in mind, if your thread is using any unmanaged resources that it doesn't release when the thread exits, the thread will hang when it attempts to exit. I've run into this on multiple occasions. If your thread doesn't seem to be terminating properly, I would look at the resources you're using in that thread and make sure any objects you use are properly Dispose()'d if their documentation says to do so.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
Hi,
I am trying to access to the click event of the controlbox item close 'X'
my form has a container ,,i have written a validation in the validating event of the container..
When i click the 'X'of form, the container validating event fires before the window_closing event... therefore i would like to access the click event of the 'X'..
pls suggest..
thanks
|
|
|
|
|
I don't understand the problem. Handle the closing event ??
only two letters away from being an asset
|
|
|
|
|
Basicaly i am looking for a event prior to the form_closing event, when i click X in that form.
|
|
|
|
|
|
You might want to ask this in the Mobile Development forum
only two letters away from being an asset
|
|
|
|
|
Hi All,
I am working on the project using c# 2.0. I need to get the contents of window.status bar and save into string variable. Please help if you can.
Thanks in advance.
A.Asif
|
|
|
|
|
What window are you talking about? The web browser's status bar?
|
|
|
|
|
yes web browser window. I am using the following code but doesn't work.
string result = LPBrowser.Document.Window.StatusBarText;
Thanks.
A.Asif
|
|
|
|
|
I'm sorry, I still don't understand. Is LPBrowser something in ASP.NET? Or is this a Windows Forms web browser control?
If it's a Windows Forms web browser, have you looked at browser.StatusText property?
If this is something in ASP.NET, I recommend you post your question in the ASP.NET forum.
|
|
|
|
|
Hi,
LPBrowser is just the name I gave to browser control. Currently I am using following code but for some reason these codes not working,
string result;
string someVar;
some Var = LPBrowser.StatusBarText //This line doesn't work
result = LPBrowser.StatusText; ///This line doesn't work
A.Asif
|
|
|
|
|
Hi everyone.
I have got some VB6 code i need to translate to C#, but i really cant understand the VB code.
The program is something that communicates with a serial dervice.
I do not know how much of the code I need to get translated, so it is possible that I will post more code later.
Until now i've got this code:
Private Sub Command1_Click()
Dim CheckSum As Byte, x, Tid
MSComm1.Settings = "1200,N,8,1"
Buffer = "GET" + vbCr
CheckAndSum Buffer ' add Checksum and Length of string
Buffer = Buffer + SumStr
'For x = 1 To Len(Buffer)
' Tid = Timer
' Do
' DoEvents
' Loop Until (Timer - Tid > 0.01)
' MSComm1.Output = Mid(Buffer, x, 1)
'Next x
MSComm1.Output = Buffer
End Sub
This should write some code to the Serial Port.
I have already got the code for creating the checksum.
When my device receives the GET command with vbCr (Carridge return), the checksum and the string Length, it should return 10 characters an example could be c=02345"Carrigde return"Checksum1Checksum2
I do not think you need more code that i pasted to do this. But I am not sure..
It would really be a great help if you could help me with this..
|
|
|
|
|
|
I already had looked at MSDN.. I have tried make some code.. But no matter what i do it doesn't seem to work..
|
|
|
|
|
Wow, one of the reasons I am out of VB6.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: one of the reasons I am out of VB6
One of the reasons I never adopted it in my shop
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
haolan wrote: Private Sub Command1_Click()
Dim CheckSum As Byte, x, Tid
MSComm1.Settings = "1200,N,8,1"
Buffer = "GET" + vbCr
CheckAndSum Buffer ' add Checksum and Length of string
Buffer = Buffer + SumStr
'For x = 1 To Len(Buffer)
' Tid = Timer
' Do
' DoEvents
' Loop Until (Timer - Tid > 0.01)
' MSComm1.Output = Mid(Buffer, x, 1)
'Next x
MSComm1.Output = Buffer
End Sub
A few questions...
Which serial port? How do you know this does not work? Where is code to listen for the result your program is expecting? What is the specification of the device that needs this input? Maybe the port parameters do not match up?
|
|
|
|