|
Do you mean that a user should login to your app at startup or enter a password on a single window at the same time as submitting these new/changed details?
I'd opt for having a login when the app started personally.
Does the database your using already have any form of user login/security mechanism? If not, this isn't a trivial thing to implement.
|
|
|
|
|
Hi JAmmer,
firstly thanks to reply me,
my database hasn't a security or better i did not put a password in my SqlServer
Jammer wrote: Do you mean that a user should login to your app at startup or enter a password on a single window at the same time as submitting these new/changed details?
I mean (my boss request ) that when a employee will add,delete or edit a record before to perform that action must appear a password to complete the action (add,delete,edit) ,he is a little pedantic because he got afraid that somebody will change the data without his permission .
I'm interested having a login when the app start ,can you explain me more in detail about this option?
Thanks
I wish you happy day.
Best Regards,
Bye
|
|
|
|
|
If you want to have a login at app start your going to have to implement some form of security database.
This is a fair sized project in its own right.
You'll have to authenticate users at login, store hashed passwords and possibly implement some form of 'user roles' that have a selection of permissions regarding things they are allowed to do and things they aren't allowed to do.
If your going to all this trouble you should also be logging what a user does, when they did it etc ...
Sounds to me like you would be wise to actually tell your boss that this is potentially a lot of work.
Its the kind of infrastructure thing that needs planning and doing in such a way that it is application independant as well. So any future apps you develop can also make use of this security model.
This is also drifting way off topic for this forum!
|
|
|
|
|
The advice that Jammer has given you is good stuff, but there is something else you can do. In ASP.NET, there is the concept of something called the Membership and Role Providers, which are used to provide authentication on a website. There's a common misconception that they can only be used on a website - this just isn't true. With a little bit of work, you can hook up a desktop application to use the same infrastructure.
Here's[^] a Win Forms example that should be relatively easy to port over.
|
|
|
|
|
Thats really interesting ...
Thanks for that Pete.
|
|
|
|
|
Hi,
Thanks for your fast reply,
i will look right now the link and after i will try ,however i will tell you if i try difficult or not.
A special warm hug...so far so good.
I wish you happy day.
Best Regards,
Bye
|
|
|
|
|
|
Thanks a lot for your lovely support.
when i will develop it i will tell you how is it..
i wish you happy day.
Best regards,
Bye
|
|
|
|
|
Hi
I'm looking for an IP Text box implementation, either with a mask or windows style (4 boxes, with the abillity to copy\paste etc)
Any one has done it before?
Thanks,
|
|
|
|
|
You can find something like that in the downloadable code examples for the Apress book PRO WPF by Matthew MacDonald(Chapter 24) but it doesn't support the paste/copy functionallity. I hope this helps
Uros Bregar
|
|
|
|
|
Hi all,
I am developing XBAP application and facing following problem.
I have created one WPF user control and trying to access it dynamycally using reflection. Project contains Page1.xaml, Page2.xaml and userControl1.xaml. Actually when project starts page1 is hosted inside browser. when button is clicked new instance of Page2 is created and hosted inside frame and instance of userControl1 is also created and placed on the page2. AS you go on clicking button same thing happened and those many pages are hosted inside the frame. but the Problem is when I navigate between these pages user control loses its state. if I place the usercontrol at design time then it does not lose the state during navigation. here is my code in button click
Dim Pg As New Page2
fraHost.Content = Pg
and code in the Page2.loaded event is as follows
Dim asm As Assembly = Assembly.LoadFrom(AppDomain.CurrentDomain.BaseDirectory & "WpfBrowApp.exe")
Dim flags As BindingFlags = BindingFlags.NonPublic Or BindingFlags.Public Or BindingFlags.Static Or _
BindingFlags.Instance Or BindingFlags.DeclaredOnly
Dim ref_types As Type() = asm.GetTypes()
'StrSearchControl is the name of usercontrol
Dim typ As Type = asm.GetType(asm.GetName.Name & "." & StrSearchControl, True, True)
Dim instance As Object
For Each ty As Type In ref_types
If ty.Name = StrSearchControl Then
instance = Activator.CreateInstance(ty)
instance.height = Double.NaN
instance.width = Double.NaN
instance.ishittestvisible = True
Me.tbpgSreen.Content = instance
End If
Next
please help me on this.
thanks in advance.
Prabi
|
|
|
|
|
Hi,
I am using a web browser control in my WPF application. I will be navigating various websites with its help. What i want is that when a certain web page gets loaded, based on the content inside that web page i should be able to identify the language which is written on that page like french , japanese etc.
Basically i want to apply the concept of Internationalization or something like that in WPF.
In internationalization we can get the web browser's language preferences by:
// Set the CurrentCulture property to the culture associated with the Web
// browser's current language setting.
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
I want the same thing for the web page that i navigate through my web browser control in WPF.
It's kind of urgent please help to find the solution soon.
Thanks in advance.
|
|
|
|
|
Hi,
I was wondering what is better for performance in WPF.
Drawing in code or using image files.
and if so, what is the best format
Thanks
|
|
|
|
|
Well, I think so using images is faster, but with XAML you can draw vector shapes as well as shapes in Flash.
It depends your want.
|
|
|
|
|
Thanks,
I just want to know, when designing a new application, which approach is best
|
|
|
|
|
If I wanna design an application , I'll use XAML code.
|
|
|
|
|
I'm fairly good with C# and WPF, but I'm relatively new when it comes to working with the new .NET 3.5 WPF RichTextBox control and it's XAML. Anyway, I needed to add a hyperlink insdie a RichTextBox control, so I found instructions on how to do this at http://blogs.msdn.com/llobo/archive/2007/08/09/3-5-features-enabled-hyperlinks-in-richtextbox.aspx[^]">, and I followed the instructions and was able to embed my own hyperlinks inside my own RichTextBox control, and they were lit up blue and underlined, and when I held down the CTRL button and hovered over them, the web browser hand pointer icon appeared, so they seemed to be enabled. However, when I hold down CRTL and click, nothing opens. I've tried this with my own links, and even with the exact same code with the exact same hyperlink on the site above. Am I missing something. What am I doing wrong?
Any help would be appreciated. If you want to reproduce this, just use the code on his site, and you'll see when you hold down Ctrl and Click, nothing actually opens.
Thanks everyone!
Justin
|
|
|
|
|
I've used this way :
XAML:
<Hyperlink Click="Hyperlink_Click" NavigateUri="http://www.mds-soft.persianblog.ir/"><Run
Text="Mohammad Dayyan"/></Hyperlink>
C# :
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
try
{
Hyperlink source = sender as Hyperlink;
System.Diagnostics.Process.Start(source.NavigateUri.ToString());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Exception", MessageBoxButton.OK);
}
}
|
|
|
|
|
Hello,
I have encountered a problem trying to draw a line with a custom pen.
What I need to do is draw a line from point X to point Y, but use a certain shape (some polygon), as opposed to the standard pen I get in DrawLine(Pen, Point, Point) interface.
There is the PenLineCap, but it is not good enough as it supports specific shapes.
Anyone has any idea how to achieve this?
Thanks.!
|
|
|
|
|
|
Iam trying to run a WPF Report Viewer(coding in vb).
But its giving the following error
"Report definition file can't be opened, error:\rObject reference not set to an instance of an object."
I have specified the OpenFileDialog.FileName also
But to no avail....
PLEASE HELLLP.....
Best Wishes ....... ARIJIT
|
|
|
|
|
You will need to set a breakpoint, and step over the code that's loading the report definition to find out which variable is null. Without seeing the code, there's no way that we can know.
|
|
|
|
|
I am giving the relevant code :
Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles button1.Click
Dim ofd As OpenFileDialog = New OpenFileDialog()
ofd.Title = "Select report definition file"
ofd.Filter = "Report definition files (*.xml)|*.xml|All files (*.*)|*.*"
If (ofd.ShowDialog() = System.Windows.Forms.DialogResult.OK) Then
Try
' parse file and select report definitions
Dim reports As String() = C1.C1Report.C1Report.GetReportList(ofd.FileName)
If (reports Is Nothing) Or (reports.Length <= 0) Then
Throw New Exception(String.Format("File {0} has no reports definitions.", ofd.FileName))
End If
tbFileName.Text = ofd.FileName
c1DocumentViewer.FileName = ofd.FileName
cbReportName.Items.Clear()
Dim reportName As String
For Each reportName In reports
cbReportName.Items.Add(reportName)
Next
cbReportName.SelectedIndex = 0
Catch ex As Exception
System.Windows.MessageBox.Show(String.Format("Report definition file can't be opened, error:\r{0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error)
c1DocumentViewer.ReportName = ""
c1DocumentViewer.FileName = ""
End Try
End If
End Sub
Please help !
Best Wishes ....... ARIJIT
|
|
|
|
|
Hi.
I have recently started learning WPF. I've written a small app with a tab control on it. I have basically finished it and works fine. But here is the thing... why can't I select the tabs like I can in a normal windows app in the design mode so I can edit controls on that specific tab? I've tried Googling for an answer, but found nothing... which got me thinking that it's not a "general problem" and that I must be doing something wrong???
|
|
|
|
|
Clicking on a TabItem's tab in the design pane should move you to that TabItem's contents.
Also, placing the caret in a TabItem's XAML should move you to that TabItem's contents.
Maybe try it with this:
<TabControl>
<TabItem Header="Tab 1">
<TextBlock Text="Text 1"/>
</TabItem>
<TabItem Header="Tab 2">
<TextBlock Text="Text 2"/>
</TabItem>
<TabItem Header="Tab 3">
<TextBlock Text="Text 3"/>
</TabItem>
</TabControl>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|