|
Dave Kreskowiak wrote: Noone can answer that question.
Who is this guy Noone? He seems to know a lot.
|
|
|
|
|
Richard Andrew x64 wrote: Who is this guy Noone?
Him[^]?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Dave,
Here are the details..
It is online Test Management System which includes Oral proficiency,Writing and Listening Tests(Like Prove it /Brain bench)with multi-lingual
Spanish,English,Chinese,Japaneses,Germany etc.
The application interaction as follows.
Candidate
Tester
Rater
Proctor
SalesRep
Appointment Availability
IVR System interaction
I really appreciate if you could help me
Thanks & Regards
Rao
|
|
|
|
|
dsrao wrote: It is online Test Management System which includes Oral proficiency
I would suspect that is going to be a very difficult feature.
At least presuming that the testing is supposed to be automated versus just video conferencing.
dsrao wrote: I really appreciate if you could help me
I would suggest hiring an architect and and someone with extensive experience in audio/visual programming.
Other specialities might arise depending on the first point above.
As per your first question your description doesn't really suggest anything that points to performance bottlenecks. But again that might depend on my first point.
|
|
|
|
|
Testing systems are not normally high performance systems, so your question is kind of meaningless.
Provided your backend data structure is designed properly, you shouldn't have any performance problems at all no matter how you design it.
|
|
|
|
|
If its a very small application (and if it is not expected to grow by size much), I would suggest you keep the architecture as simple as possible.
Without knowing the size of the application (and also what it is doing) it is impossible to give the right answer.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Hi ,
i wish build a control(wpf) that the Eye(Ellipse) follow the cursor of the mouse.
here is a snippet code that i am developing :
<Window Height="480" Title="Window2" Width="640" x:Class="WpfApplication5.Window2"
x:Name="Window" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Window.Resources>
<Storyboard x:Key="OnLoaded1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ctrCircle"
Storyboard.TargetProperty="(UIElement.RenderTransform).( TransformGroup.Children)[3].(TranslateTransform.X)">
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="ctrCircle"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseOut" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Style TargetType="Ellipse">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1"/>
</Setter.Value>
</Setter>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
</Style>
</Window.Resources>
<Canvas MouseMove="mov" x:Name="LayoutRoot">
<Border ackground="Black" B="" Canvas.Left="178" Canvas.Top="103"
CornerRadius="250" Height="255.5" Width="290" x:Name="border_eye">
<Ellipse Fill="#FFFFC600" Height="12" HorizontalAlignment="Left"
Margin="0" RenderTransformOrigin="0.5,0.5" Stroke="{x:Null}"
VerticalAlignment="Center" Visibility="Visible" Width="12" x:Name="ctrCircle">
<Ellipse.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform />
<TranslateTransform />
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
</Canvas>
</Window>
and in the code behind :
private void mov(object sender, MouseEventArgs e)
{
System.Windows.Point pt = e.GetPosition((Canvas)sender);
Storyboard invokeStoryboard = this.Resources["OnLoaded1"] as Storyboard;
((DoubleAnimationUsingKeyFrames)invokeStoryboard.Children[0]).KeyFrames[0].Value = pt.X;
((DoubleAnimationUsingKeyFrames)invokeStoryboard.Children[1]).KeyFrames[0].Value = pt.Y;
invokeStoryboard.Begin();
}
now my purpose is when i move the mouse in the Canvas area(LayoutRoot) the Ellipse(ctrCircle) move only inside the Border(border_eye) and don't overcome the area of the "border_eye" this effect is similar an eye.
Do you have any idea how to perform this step?
Thanks so much for your attention
Have a nice day.
modified on Friday, November 5, 2010 1:16 AM
|
|
|
|
|
That XAML makes my brain hurt. Maybe you should use the PRE tag on it rather than the CODE tag. The PRE tag maintains the indentation.
|
|
|
|
|
Hi aspodotnetdev,
i tried to modify it but i can not fix it well i don't know why, i will try again.
Thanks
Edit... i tried to use PRE tag but when i post the code many lines of code disappear ,i am so sorry if it is not fix well.
|
|
|
|
|
VisualLive wrote: i tried to use PRE tag but when i post the code many lines of code disappear
Hmmm, maybe that's related to a bug I reported here.
|
|
|
|
|
You needed to HTML encode your XML. I've fixed it
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Hi Chris,
you are so kind to do that,i will remind for the next time i post a code.
Thanks so much .
Have a nice day.
|
|
|
|
|
You may get a better reponse to your query in the WPF forum.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi Richard,
truly i believed it was the WPF Forum ,so it was my mistake .
Thanks for your suggest,i moved this question to the WPF Forum.
Have a nice day.
|
|
|
|
|
I have a template StartPage.xaml file, and I understand XAML well enough.
What I don't understand is how/where the page is getting it's data.
In addition, there's no .CS file ain this project. Where do you put the code behind?
Anyone have any experience with this?
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
|
Nishant Sivakumar wrote: See http://msdn.microsoft.com/en-us/library/ee663382(v=VS.100).aspx[^]
Ya useful link.
Take 5
|
|
|
|
|
hi!
My query is that, If i enter some text in textbox the matching record from the database column display.
I am using windows application
e.g.: google, if we enter some text related text displayed.
thanx
|
|
|
|
|
|
|
Hi Guys,
I'm working on a windows service which runs under a given service account. It writes files to shared areas on other machines, but needs to change the owner of these files to a different account. I can do this using the SetAccessControl as below:
public static void SetOwner(string uri, string account)
{
System.Security.AccessControl.FileSecurity security = File.GetAccessControl(uri);
IdentityReference owner = new NTAccount(account);
security.SetOwner(owner);
File.SetAccessControl(uri, security);
}
However, this only works if the service account which I'm using is an administrator or backup operator on the remote machine (unless it's setting the owner to itself). I'd like to avoid giving this service account rights to too many machines, since that puts too much power in the hands of one account. Instead, I'd like to provide a username and password for the account which will be the owner of the file, and have the service impersonate this account when assigning ownership (e.g. in a similar way to how you could have credentials in a connection string for a database connection which didn't use trusted authentication). I'm looking for something like the code below, but have so far been unable to find an understandable example to work from.
public static void SetOwner(string uri, string account)
{
StartImpersonating(account);
System.Security.AccessControl.FileSecurity security = File.GetAccessControl(uri);
IdentityReference owner = new NTAccount(account);
security.SetOwner(owner);
File.SetAccessControl(uri, security);
StopImpersonating();
}
static void StartImpersonating(string account, string password)
{
System.Security.Principal.WindowsIdentity.Impersonate(account, password);
}
static void StartImpersonating(string account)
{
string password = GetPasswordFromSecureStore(account);
StartImpersonating(account, password);
}
static void StartImpersonating(string domain, string username)
{
StartImpersonating(string.Format("{0}\\{1}",domain,username));
}
static void StopImpersonating()
{
StartImpersonating(System.Environment.UserDomainName,System.Environment.UserName);
}
NB: the above code is just for illustrative purposes to show the sort of thing I'm looking for; I've no idea whether what's there is even close to what's required to acheive this.
Any advice, pointers, or intPtrs appreciated.
Thanks in advance,
JB
|
|
|
|
|
Seek and ye shall find Windows Impersonation using C#[^].
It's from '03 but im sure the pricipals are still the same, you are going to have to call the Windows API to get done but the above link should help you out.
Don't comment your code - it was hard to write, it should be hard to read!
|
|
|
|
|
Hi JB,
I used this in a small test I composed on impersonation:
static void TestProcessLogs(string path)
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
IntPtr token;
#region User / Password
String user = "xxxxxx";
String domain = "xxxxx";
String pass = "xxxxxxx";
#endregion
if (LogonUser(user, domain, pass, 9, 0, out token))
{
WindowsIdentity fromIdentity = new WindowsIdentity(token);
WindowsImpersonationContext context = fromIdentity.Impersonate();
ProcessLog(@"\\xxxxxxx.xxxxxxx.xxxxxx\f$\Connector\LNWorkerDir\705-SORL9002-PGBU-WEC-US-productn-octtic\peqdLN02\all.log");
context.Undo();
}
}
and here comes the definition of LogonUser. Place this within a class definition:
[DllImport("advapi32.dll", SetLastError = true)]
public static extern bool LogonUser(string lpszUserName, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, out IntPtr phToken);
Best regards
Manfred
|
|
|
|
|
That's perfect. Thanks to both of you for the link & code sample; very much appreciated.
I've put this code into a disposable object, so that you can easily swap contexts, using the using statement to control when you impersonate another account. Hopefully this will be of use to anyone following this thread in future.
e.g.
class Program
{
static void Main(string[] args)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<demo />");
doc.Save(@"\\server\share\demo1.xml");
using (Impersonator impersonate = new Impersonator(@"domain\user"))
{
doc.Save(@"\\server\share\xjbdemo2.xml");
}
doc.Save(@"\\server\share\xjbdemo3.xml");
Console.WriteLine("Done");
Console.ReadKey();
}
}
public class Impersonator: IDisposable
{
#region windows api reference
#region enums
public enum LogonType
{
LOGON32_LOGON_INTERACTIVE = 2,
LOGON32_LOGON_NETWORK = 3,
LOGON32_LOGON_BATCH = 4,
LOGON32_LOGON_SERVICE = 5,
LOGON32_LOGON_UNLOCK = 7,
LOGON32_LOGON_NETWORK_CLEARTEXT = 8,
LOGON32_LOGON_NEW_CREDENTIALS = 9,
}
public enum LogonProvider
{
LOGON32_PROVIDER_DEFAULT = 0,
}
#endregion enums
[DllImport("advapi32.dll", SetLastError = true)]
static extern bool LogonUser(string lpszUserName, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, out IntPtr phToken);
void Impersonate(string account)
{
Impersonate(account, GetPassword(account));
}
void Impersonate(string account, string pass)
{
string[] accountSplit = SplitAccount(account);
Impersonate(accountSplit[0], accountSplit[1], pass);
}
void Impersonate(string domain, string user, string pass)
{
IntPtr token;
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
if (LogonUser(user, domain, pass, (int)LogonType.LOGON32_LOGON_NEW_CREDENTIALS, (int)LogonProvider.LOGON32_PROVIDER_DEFAULT, out token))
{
WindowsIdentity fromIdentity = new WindowsIdentity(token);
this.context = fromIdentity.Impersonate();
}
else
{
throw new NotImplementedException("Logon Issue");
}
}
#endregion windows api reference
#region fields
const string DOMAIN_USER_SEPARATOR = @"\";
WindowsImpersonationContext context;
#endregion fields
#region constructor
public Impersonator(string account)
{
Impersonate(account);
}
public Impersonator(string account, string pass)
{
Impersonate(account, pass);
}
public Impersonator(string domain, string user, string pass)
{
Impersonate(domain, user, pass);
}
#endregion constructor
#region helper methods
string GetPassword(string account)
{
string[] accountSplit = SplitAccount(account);
return GetPassword(accountSplit[0], accountSplit[1]);
}
string GetPassword(string domain, string user)
{
string pass = string.Empty;
pass = "todo";
return pass;
}
string[] SplitAccount (string account)
{
string[] accountSplit = account.Split(DOMAIN_USER_SEPARATOR.ToCharArray(), 2);
return accountSplit;
}
#endregion helper methods
#region disposal pattern
private bool disposed = false;
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
}
this.context.Undo();
this.context.Dispose();
disposed = true;
}
}
~Impersonator()
{
Dispose (false);
}
#endregion disposal pattern
}
Thanks again,
JB
|
|
|
|
|
Hi JB,
thanks for sharing your class with us.
I have some issues with your design though:
1. In the constructor I would not call Impersonate(...) straight away.
There are two reasons for this:
a.) Code in a constructor that will likely cause an exception
is a real pain in the a**e.
b.) Let the user of your library decide when Impersonation starts
and ends.
Store user account and domain in instance variables. Password should not be stored in
the class (as you have already done) but could be retrieved via GetPassword() (see 2.).
I would make an additional overload Impersonate() a public function and add another function
like Revert() that will call context.Undo() and set context = null. bool IsImpersonating()
would be nifty (context != null) too.
2. Move the function GetPassword to a separate class that implements an interface say
IStringPasswordProvider. Have a property that allows the user of your library to inject
an instance of his or her own implementation of IPasswordProvider.
public interface IStringPasswordProvider
{
String GetPassword(String account);
String GetPassword(String account, String domain);
}
public class DefaultPasswordProvider : IStringPasswordProvider
{
string GetPassword(string account)
{
string[] accountSplit = SplitAccount(account);
return GetPassword(accountSplit[0], accountSplit[1]);
}
string GetPassword(string domain, string user)
{
string pass = string.Empty;
pass = "todo";
return pass;
}
}
A password provider might read passwords from a DB or may be the app.config (web.config) file.
Please let me know what you think of these changes.
Best Regards
Manfred
|
|
|
|
|