|
You must set up impersonation in your Web.config file. See the documentation on the <identity> config section in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
In you case I think windows has Authenticated your user and it is using NT AUTHORITY\SYSTEM to run your code.You have to use impersonation so that when you use that code line you will get correct user.
Second solution could be to implement IPrincipal and explicitly set user information.
Education is no substitute for intelligence. That elusive quality is defined only in part by puzzle-solving ability. It is in the creation of new puzzles reflecting what your senses report that you round out the definition. Frank Herbert
|
|
|
|
|
Hi thanks for your reply.
I seem to have found a solution by using Context.User.Identity.Name which returns the userid I was expecting of it
Thanks once again
|
|
|
|
|
is there a way to hide the email address in a multiple To: textbox. i wish to send emails to groups of people but i dont want the recipients knowing each other email addresses?
|
|
|
|
|
use BCC (Blind Carbon Copy)
not To..
(this should no be sent in the C# forum)
|
|
|
|
|
yes it took me an hour to figure it out. many thanks
|
|
|
|
|
I want to use the:
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
}
what do I add in the #region Windows Form Designer generated code
private void InitializeComponent()
{
}
Something like:
this.OnClosing += new System.Windows.......
Thanks
Thomas
|
|
|
|
|
Open the form in design mode.
Select the form and pull up the property window.
In the top of the property window you will see a lightning bolt; click it.
Now all events for the form are visible.
Locate Closing, place cursor in open box, double-click.
Your method signature and your delegate registration is done for you.
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
Hi,
I am beginner in .NET world. may you give the right address of such "lightning bolt" ...
I have VS.NET 2003, where can I find such thing?
Thanks
Fari
|
|
|
|
|
I am using VS.NET 2003 as well. But the directions remain the same regardless of version.
Just as I said:
Open your form and select it in the designer window.
Select the properties page.
Click the icon at the top that is a lightning bolt.
There is no address per se.
|
|
|
|
|
OnClosing is marked as virtual . The framework code calls it when the form is closing. There is nothing to monkey with in the Designer section since it will be called whether you override it or not.
|
|
|
|
|
The event is Closing and the delegate type is CancelEventHandler . Without using the VS.NET, you add a line like so:
this.Closing += new System.ComponentModel.CancelEventHandler(MyMethod);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am developing an application that is primarily keyboard not mouse driven. Navigation is very difficult within some controls (list boxes, radio groups etc) unless the focus rectangle is visible. When an application starts the focus rectangle for a control is never visible and only becomes visible once the TAB key is pressed. After that everything works OK. In a list box I have looked at the ChangeUICues event of the control and there is a read only property ShowFocus which indicates if the focus rectangle will be displayed. Is there a way to set this to yes? Ideally what I need is if I have a form with one list box control, with say 10 items listed, that it starts with the focus rectangle around the first item without having to press TAB.
Any help greatly appreciated.
Regards
Stephen
|
|
|
|
|
I just built a simple app with a listbox in it and kept playing with what was needed to accomplish what you want. I ended up with
this.listbox1.Selected();
This put the focus rectangle inside the listbox.
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
Thanks for your reply.
I could not get your suggestion to work. I created a new project. Dropped a list box on the form. Created 5 items using the items collection in the IDE. Put
this.listbox1.Selected() in the load form event first and then the list box enter event. In both cases I got the items displayed with no focus rectangle until I press TAB.
Where did you put the this.listbox1.Selected() statement?
Regards
Stephen
|
|
|
|
|
It is in my Load logic. But I am using Select() not Selected()
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
Thanks again for your help.
I was also using Select() in my form load event.
Can you email your project? I must be doing something wrong or maybe you are using a different version of VS.Net. Are you doing this in a Windows or Web form?
Regards
Stephen
|
|
|
|
|
Can someone tell me how to create the certs for Quickbooks integration. I'm using IIS 6.0 and I already have a verisign cert so I can't create a request cert for intuit. I have a web app that i'm hopeing i can integrate quickbooks with. There is a SDK for this but it's geared toward Java apps. Any help is appreciated.
|
|
|
|
|
Hello,I am Adding 5 tables one by one into a HashTable with tablename as value and "Select * from tableName where PrimaryKeyFieId = -1" as Key.Now I want to add it in the order I have written the statements but it is taking in some specific order.If anyone can suggest solution I would be grateful to him/her.
Bugfixer
|
|
|
|
|
A Hashtable doesn't care about order. It's uses hashes to place items in buckets and resizes itself when needed. This is a relatively simple data structure that is taught in most beginning and intermediate programming classes.
Instead, use a System.Collections.SortedList which also impements IDictionary .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How to read Ladder diagrams using C#? Is there any way to insert ladder diagrams in .rtf file?
please guide
|
|
|
|
|
Same as any other document: write a parser than displays objects. Since there doesn't appear to be a standard for a ladder diagram document, you have to design your own data structures. This is really no different than what charting applications would need to do. Using .NET runtime serialization with an abstract object model would probably be best. The implementation is entirely up to you.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
could you please elaborate more.
thanks
|
|
|
|
|
As it turns out, there's one standardization project currently in design phase. See http://www.bbdsoft.com/control.html[^]. It uses an XML document to save the ladder logic. In this case, it'd be better to use XML Serialization (see the System.Xml.Serialization namespace in the .NET Framework SDK), but to still design an abstract data model where the objects are still drawn on the screen using suitable representations. There is a Java project already using this recommended spec I linked above if you want examples. See http://www.bbdsoft.com/j-ladder.html[^].
It's amazing what a simple search for "ladder diagrams" on google[^] can turn up.
As far as embedded this in an RTF, the easiest way would be to allow your application to draw the images to a device context instead of the screen device context and then save that to an image. Simply embed the image in RTF. Attempting to use OLE requires a good working knowledge of OLE, how to embed OLE in RTF, and how to expose CCW effectively from .NET components.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Images won't help here, as, if we compress the image of ladder, the thin lines may disappear and the ladder become useless.
regards
|
|
|
|