|
Hello everyone,
Is there any way I can create WCF web sevice from a wsdl? (not a proxy class from svcutil).
I know how to create one in normal way but when I createit manually , the WSDL file gets changed which I dont wont.
Thanks in advance,
Regards ,
Nishu
|
|
|
|
|
I've been having some problems with admin rights. Im developing an application to be installed by a network admin but what i need is for the program to maintain admin rights when anyone uses it. Is this possible?
Duncan
|
|
|
|
|
Yes and no. You really don't want your application to run as an administrator unless the user is an administrator. That is one of the security features of Windows. However, you can impersonate a given user or you can design your application as a service and set the service to run under a specific user account.
|
|
|
|
|
Thank you for replying and i understand what your saying. Kinda...lol
To define my problem better though, my app is installed on the root drive which also means my settings are installed on root, if a user wants to change these settings they must have admin rights, how do i get round this
many thanks
Duncan
|
|
|
|
|
You don't. You application can request that it runs as the users admin account, if they have one (Vista and above), using a manifest. On XP and below, you simply have to trust that the user is an administrator and handle the case of not being able to write to the file if the user is not. Administrative permissions only go to user accounts, not applications. When a user launches an application, the application inherits the users security token, in effect, impersonating the user that launched the app. The application cannot get more permissions than the user has available to him/her.
|
|
|
|
|
Install your application in %program files% as suggested by MS and then read/write user settings to and from Application.UserAppDataPath
|
|
|
|
|
hey there,
to set custom headers to a datagridview, you can use the DisplayNameAttribute. Any idea how to change the order of the columns likewise?
Greetings and thanks in advantage!
|
|
|
|
|
Did you mean PropertyGrid , rather than DataGridView ?
AFAIK the DisplayNameAttribute class alters the displayed name of a property in a PropertyGrid . I have not tried it on a DataGridView , but am disinclined to think it would work.
If you are sure that you mean DataGridView , then please post the relevant section of your code, so that people can more easily understand your problem.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
I am not able to follow your link, because of problems with my internet connection at the moment, although I do not generally follow links given by people I don't know. I mean no offence by that, but we do get some weird people on here.
So as you aren't posting the code snippet, the best I can do is to say that as far as I know there is no DisplayIndex attribute. DataGridViewColumn does have that property though, but from the wording of your original question, I guess that you already know that.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Well, tahnks.
That would have been the content of the link:
using System;
using System.Windows.Forms;
using System.Data;
using System.Collections.Generic;
using System.ComponentModel;
namespace WindowsApplication102
{
public partial class Form1 : Form
{
public Form1() { InitializeComponent(); }
private void Form1_Load(object sender,EventArgs e)
{
Person[] personen = new Person[]{new Person("Frank",42),
new Person("Eva",34), new Person("Luca",2)};
dataGridView1.DataSource = personen; this.Width = 300;
}
public class Person
{
private string name;
private int alter;
private DateTime geburtstag;
public override string ToString()
{
return (name);
}
public Person(string name,int alter)
: this(name,alter,DateTime.Now.AddYears(-alter)) { }
public Person(string name,int alter,DateTime geburtstag)
{
this.Name = name;
this.Alter = alter;
this.geburtstag = geburtstag;
}
[DisplayName("MeinName")]
public string Name
{
get { return name; }
set { name = value; }
}
[Browsable(false)]
public int Alter
{
get { return alter; }
set { alter = value; }
}
public DateTime Geburtstag
{
get { return geburtstag; }
set { geburtstag = value; }
}
}
}
}
|
|
|
|
|
delete
modified 2-Apr-21 5:24am.
|
|
|
|
|
For the xml file, you can use Build Action as Embedded Resource. But this means that you will have to change the way you read the xml file now. You will have to read it from the assembly.
For Dlls, do you have the source code?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
yes i have the source code can you explain me how that careful work with the xml how i must drop it and how can i open it?
pc17
|
|
|
|
|
If the dlls are written in C# and you have the source then you can do it this way:
Create backups of everything - just in case!
Open the project that is compiled to the exe.
In that solution, choose Add Existing Project for each of the projects that compile to dll and add each one.
Create folders with the same names as the dll projects in the exe one.
Select all files in each dll project and drag and drop to the respective folder.
Remove the dll projects from the solution.
You may have to play around a little if any of the projects are using a resources file etc, but generally speaking it should just work.
|
|
|
|
|
Yes, but...
I create the directory first and add right into it and I usually Add as link so I don't copy the files needlessly.
|
|
|
|
|
PC17 wrote: must be in the same folder otherwise the program doesn´t work
That's not entirely true.
You can probably embed the XML in the EXE as a resource.
If you wanted the EXE and DLLs in one file, why did you make the DLLs?
|
|
|
|
|
That i can use it for more things so i have no very long source code!
Who would this work with the resoucen i take the 4 files as resouce and then how can i open it?
PC17
|
|
|
|
|
PC17 wrote: That i can use it for more things
Consider putting the DLLs in the GAC.
|
|
|
|
|
When all code is C#, you could create a single project holding all the source files; and add the XML file to it, with BuildAction=EmbeddedResource. Then you need a bit of code to extract the XML as a string, replacing your file reading code.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
For the xml file, add it as an EmbeddedResource as others have already said.
For the dlls, can use ILMerge to merge them with your exe.
|
|
|
|
|
i'm trying to create 2 custom controls, once you compile, you have a nice custom control up in the visualstudio I.D.E..
i would like to achieve, the once a dragged 'MenuStrip' onto my form and start adding item, that these items are also a new created costrum control 'cToolStripMenuItem', instead of standart item
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
namespace OwnerDraw_Test_3
{
class CMenuStrip : MenuStrip
{
}
class cToolStripMenuItem : ToolStripMenuItem
{
}
}
kind regards
Bad = knowing 2 much
modified on Thursday, September 24, 2009 2:41 PM
|
|
|
|
|
And your problem is?
What have you tried?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
wel, i'm trying to achieve, that items added to the menuStrip, are the items from my class and not the standart System.Windows.Forms.ToolStripMenuItem().
without anyneed to manualy moding the form1.designer.cs
this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem1 = new OwnerDraw_Test_3.cToolStripMenuItem();
Bad = knowing 2 much
|
|
|
|
|
Well, you are deriving your own class from MenuStrip, so you are in control of what happens in there. All you have to do is override any methods/events where a MenuItem is added/inserted/deleted. That is a lot of work, though.
Alternatively you can just create your own OwnerDraw_Test_3.cToolStripMenuItem() , as you are doing. What else you need to do will depend on whether you are only going to add them in code, or if you need design time support.
For design time support, look up the documentation for the ToolStripItemDesignerAvailability attribute. From there you should find links that will help you in designing the cToolStripMenuItem .
For code only implementation, it is surely only a matter of casting to cToolStripMenuItem wherever there is interaction with your control.
Sorry not to be more help, but my internet connection is playing up, and it takes about 5 mins to get a google search up at the moment, otherwise I would have given you more specific links.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|