|
Looks like you need to start with the very basics. Read a book.
Using the RadioButton class[^] will have you create radiobuttons for gender.
|
|
|
|
|
Windows mobile also allows .net programs, but symbian doesn't without adding the proprietary .net runtime from redfivelabs . The API for getting your contacts is on both platforms wildly different.
So How can i add <big>.net runtime from redfivelabs</big> .
|
|
|
|
|
Add it to WHAT??
But, in any case, why are you not asking REDFIVELABS this question?? After all, they wrote the bloody framework and should know how to support it!
|
|
|
|
|
BUT there website is down.
How can i add .net runtime from redfivelabs?
|
|
|
|
|
Wait until their site is up.
|
|
|
|
|
HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
When run the program on my nokia i get
"LUNCHER Not supported runtime!
|
|
|
|
|
No one has heard of this thing. We have no idea what it takes to install it! The only people you can ask are the people who wrote the library. Oh wait, their website is gone. So guess what? Do you think you should be using the product??
|
|
|
|
|
He was told he shouldn't be trying to write for Symbian in C#, but he decided not to listen.
|
|
|
|
|
Yeah, I thought it sounded vaguely familiar.
|
|
|
|
|
So Please give any idea for coding symbian via C#
|
|
|
|
|
Which part of this[^] answer confuses you? If you want to write for Symbian then, at the moment, you can't use C#.
|
|
|
|
|
Hi everyone! I'm having problem accessing values of controls from a different thread that did not create them. The code is long and so I will give a clear explanation of the problem.
I have a Windows Form that gets data to be stored in a database. Because I do not want the main window to hang, I have written the code that stores the data in the database in a different thread. When the new thread is started, the main thread shows a dialog control with animated image showing that the data is being processed. When the worker thread completes, the animated dialog control closes and the main thread contines execution.
Thus, when the animated dialog control is shown, the main thread waits for the worker thread to complete for the outcome of the processing before continuing or aborting depending on the outcome from the workert thread. However, the problem:
Because the worker thread did not create the controls, I'm finding it difficult to access the values of the controls on the Form. Using Control.Invoke is also not helping because the main thread has a an animated dialog control shown and waiting for data processing status from the worker thread.
I don't know how to access and update values of the controls. Any better way to solve this problem? Thanks in advance.
|
|
|
|
|
|
The worker thread should not be accessing the controls on the form, at all. If they need any data, package it up into a object specially made to pass this data to the worker thread. There is no restriction on a seperate thread accessing data this way as there is on accessing controls.
|
|
|
|
|
If you are using a BackgroundWorker , the RunWorkerCompleted event delegate has a RunWorkerCompletedEventArgs argument that contains a Result property. You can set this property with the value you wish to exchange and read it back from your main thread.
|
|
|
|
|
Hi,
I am trying to get some logged-on user details from a service running as LocalSystem.
After spending the weekend trying to find the best way of doing this, having found that the P/Invoke method is lengthy and arduous and that the get-owner-token-from-process method isn't suitable in this instance I am trying the following method but it won't compile giving non-useful errors.
The code:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_ComputerSystem");
foreach (ManagementObject queryObj in searcher.Get())
{
string LOU = (queryObj["UserName"].ToString());
WindowsIdentity wi = new WindowsIdentity(LOU);
WindowsImpersonationContext ctx = null;
ctx = wi.Impersonate();
WindowsPrincipal wp = new WindowsPrincipal(wi);
string LOU1 = wi.Name;
string AuthType = wi.AuthenticationType;
string Authd = wi.IsAuthenticated.ToString();
string isGuest = wi.IsGuest.ToString();
string SidNo = wi.Owner.ToString();
string SidPlain = wi.Owner.Translate(typeof(System.Security.Principal.NTAccount)).ToString();
string Token = wi.Token.ToString();
Console.WriteLine(LOU1);
Console.WriteLine(AuthType);
Console.WriteLine(Authd);
Console.WriteLine(isGuest);
Console.WriteLine(SidNo);
Console.WriteLine(SidPlain);
Console.WriteLine(Token);
foreach (System.Security.Principal.IdentityReference group in wi.Groups)
{
Console.WriteLine(group.Translate(typeof(System.Security.Principal.NTAccount)));
}
Can anyone shed some light on this please?
|
|
|
|
|
CCodeNewbie wrote: it won't compile giving non-useful errors.
They may appear non-useful to you, but unless you tell us what they are then it's difficult to help.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Errors are:
1) When deploying an office solution, check to make sure you have fulfilled all necessary security requirements"
- not deploying an office solution
2) Use a certificate to obtain the required permission/s
- haven't had to do this in other impersonations
3) If an assembly implementing the custom security object references other assemblies, add the reference assemblies to the full trust assembly list
- don't think this is accessing anything else as I am currently testing it as a standalone Console App running under the original user (i.e. not local system)
4) Get general help for this exception
|
|
|
|
|
It would be much more useful if you used copy and paste from the output of the compiler so we can see the actual lines of code that the compiler is complaining about.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi Richard,
The output fails after the first writeline with the pop-up box containing the list of errors in my previous post.
I have put the code into my service but now I am getting an error (catch exception sends the error to my eventlog)
"System.Security.SecurityException: Incorrect function.
at System.Security.Principal.WindowsIdentity.KerbS4ULogon(String upn)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName, String type)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName)
at Smith.Smith.OnTimedEvent(Object source, ElapsedEventArgs e)
The Zone of the assembly that failed was:
MyComputer"
I think the string from "string LOU = (queryObj["UserName"].ToString())" may not be the correct UPN although I am getting domain\username as the output.
Doing a bit of research now...
|
|
|
|
|
Those aren't compiler errors, they might be run-time exception messages. And either way, they normally also provide file, class and line number information which you should work on. Have you learned nothing in the months you were coding and asking questions here?
|
|
|
|
|
Hi Luc,
As mentioned in my post to Richard (believing that the errors were indeed of a run-time nature) I put the code back into the service which generated a more accurate description of what the cause of the error is - I think the error in the formatting of the UPN that is being passes to wi - the error is
UserInfo write failed for host 2. Reason System.Security.SecurityException: Incorrect function.
at System.Security.Principal.WindowsIdentity.KerbS4ULogon(String upn)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName, String type)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName)
at Smith.Smith.OnTimedEvent(Object source, ElapsedEventArgs e)
The Zone of the assembly that failed was:
MyComputer
from the line "WindowsIdentity wi = new WindowsIdentity(logonuser)"
string LOU = (queryObj["UserName"].ToString());
string[] LOUser = LOU.Split('\\');
string logonuser = (LOUser[1]+"@"+LOUser[0]);
WindowsIdentity wi = new WindowsIdentity(logonuser)
following the suggestions at http://forums.asp.net/p/1095241/1654338.aspx[^] and http://msdn.microsoft.com/en-us/library/windows/desktop/aa380525(v=vs.85).aspx[^]
From the error I gather that it is a constructor error but as the constructor is legal (or at least compiles in the service if not in the Console APP.) I am stuck.
I am sorry if my ignorance disappoints you, quote " " unquote.
Yes, I am learning but as stated above, when the compiler/execution throws me a curve-ball I do struggle sometimes, especially when after multiple hours of research, trial-and-error and throwing code at the problem leaves me back where I started.
I do not develop code as a profession, I try and grab a few hours a week where time allows to try and develop an app that would help me and others in the job that I do.
Out of curiosity, which of my previous posts refers to the issues I am encountering above?
|
|
|
|
|
CCodeNewbie wrote: giving non-useful errors.
that is a non-useful statement.
When YOU don't understand a message, it means you MUST provide it in your post so others could provide detailed help.
BTW: your code compiles just fine, when put in a file; inside a namespace, class, and method; with the right usings and references added.
|
|
|
|
|
using Microsoft.Win32;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Net;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Text;
using System.Threading;
using System.Timers;
using System.Windows.Forms;
namespace MyProgram
{
class Program
{
static void Main(string[] args)
{
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_ComputerSystem");
foreach (ManagementObject queryObj in searcher.Get())
{
string LOU = (queryObj["UserName"].ToString());
Console.WriteLine(LOU);
Console.ReadLine();
WindowsIdentity wi = new WindowsIdentity(LOU);
WindowsImpersonationContext ctx = null;
ctx = wi.Impersonate();
WindowsPrincipal wp = new WindowsPrincipal(wi);
string AuthType = wi.AuthenticationType;
string Authd = wi.IsAuthenticated.ToString();
string isGuest = wi.IsGuest.ToString();
string SidNo = wi.Owner.ToString();
string SidPlain = wi.Owner.Translate(typeof(System.Security.Principal.NTAccount)).ToString();
string Token = wi.Token.ToString();
Console.WriteLine(AuthType);
Console.WriteLine(Authd);
Console.WriteLine(isGuest);
Console.WriteLine(SidNo);
Console.WriteLine(SidPlain);
Console.WriteLine(Token);
foreach (System.Security.Principal.IdentityReference group in wi.Groups)
{
Console.WriteLine(group.Translate(typeof(System.Security.Principal.NTAccount)));
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
}
I know there are a lot of non-required references listed but I have just copied and pasted from the service into the Console App. while testing the code. Am I missing one?
|
|
|
|
|
Hi there, I would like to convert an audio file into binary display (0000 1010 0001 1001 ..... ) and then to use in this display in my project in C#.
how can i do that ?
thank you, kfir.
|
|
|
|