|
WiB wrote:
Server doesn't have a cofig file
Then copy the one from the WWWroot
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hi,
I'm writing a windows service, and I need the service to save data in the currently logged in users home directory (my documents). Is there a way to get the path for it?
I know Environment.GetFolderPath(Environment.SpecialFolder.Personal), but it gets the home directory of the user who runs the service (in my case the local system account).
Thanks in advance!
Greets,
Daniel
|
|
|
|
|
Do you already know anything about the currently logged in user? If so, you might want to try impersonating that user and then trying the command you just described. (Never done it, but read about it a few times.)
John
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
I doubt there is a managed method for doing this.
Under C# this will be cumbersome (lots of Interop calls), maybe the best way is MC++, but the only way I know for a service to interact with the logged in user(s) is by calling OpenWindowStation. In your case, you should call the GetUserObjectInformation to get the user SID, then go to the registry and recover the path of the user's home directory.
Not for those who fear API calls.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
How can I map the server path in an asmx file for FileIO purposes. Relative path seem to return errors.
Tia
|
|
|
|
|
I'm talkin' absolute rubish and trying to Server.MapPath a global variable before initialising the class.
Sorry dudes.
|
|
|
|
|
Hi,
I'am searching a hint or a good example for following problem :
I have zipcodes and towns. One zipcode can be attached too 1 or more towns
ex. 1000 Town1
1000 Town2
1001 Town3
1002 Town4
...
In my form a combobox is not efficient (there are too many zipcodes and towns). So, I need another button that opens a dialogbox. This dialogbox show all records (zipcode - town) and when I double-click on a record I come-back too my form, where the choosen zipcode is in one textbox and the town in an other textbox.
Thanks in advance for the hints or the examples.
Nic
|
|
|
|
|
This type of thing is done fairly often. I'd suggest browsing through the C# projects already on this site until you find one that opens a sub-dialog and then retrieves the values selected. (In fact, the SaveFileDialog and OpenFileDialog boxes that are part of the .NET framework do the same type of job.)
John
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
In order to be able to switch the Tracing level on our application (which is a service) without stopping it, I implemented a Trace wrapper that watches fot the app.exe.config file to be noticed on any change on it (NotifyFilters.LastWrite ). The wrapper has other utilities too and is compiled in a class library.
I wrote a small exec that tests the wrapper. When I start the program in debug mode (F5 ), and I change the config file using a file editor, the program is noticed (the FileSystemWatcher.Changed event is raised). But when I start the program in non-debug mode (Ctrl-F5), and I change the config file, the program is NOT notified of the change.
Do anybody have any clue of what is happening?
|
|
|
|
|
Anyone knows what is the equivalant of InternetCheckConnection(...) in C#??
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
I have a big problem when reporting from MS SQL database!
I created a report which should report from MS SQL db table T. When I try to show report it always prompts me to connect to database (ask me to enter username, password, server, database). It does that even if I programmatically set
CrystalDecisions.Shared.TableLogOnInfo logOn =
new CrystalDecisions.Shared.TableLogOnInfo();
logOn.ConnectionInfo.DatabaseName = "dbName";
logOn.ConnectionInfo.Password = "password";
logOn.ConnectionInfo.ServerName = "serverName";
logOn.ConnectionInfo.UserID = "userName";
logOn.TableName = "TableName";
Report.Database.Tables["TableName"].ApplyLogOnInfo(logOn);
Why???? What am I doing wrong?
thanx
|
|
|
|
|
i have a client / server application, i'm using Sockets, and BinaryReader, BinaryWriter.
the application supports multiclient, so i'm using multithreading.....a thread for each client
i have a problem in disconnecting both the server, and the clients...
i do not know in what sequence should i close the thread, the sockets, and the reader/writer !!!!
for both the server and the client
plzzzzzzzzzzz can anyone help me !!!
P.S: this application is my graduation project, which will
be discussed in two days !!!!!!!!!
|
|
|
|
|
Socket connections can have either connection closed first. The documentation describes how to close an open socket. (Depending upon how a socket is opened, closing a reader or writer may close the underlying socket. Just use some try/catch handlers with Trace.WriteLine(err.ToString()) to catch and understand any errors with what you try.)
John
"We want to be alone when we hear too many words and we feel alone when it has been a while since anyone has spoken to us." Paul David Tripp -- War of Words
|
|
|
|
|
can i embed internet explorer in my application?
if possible please guide me on this
ASIM
Asim
|
|
|
|
|
Yes, you can do it in some ways, the easiest one is customizing the toolbox and adding from the COM Components tab, the "Microsoft Web Browser" (\system32\shdocvw.dll), then you just need to drag it to your form. To get more information about how to use it check this link
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/browser_control_node_entry.asp
|
|
|
|
|
thank u very much sir.
i got it.
ASIM
Asim
|
|
|
|
|
http://www.codeproject.com/books/0764549146_8.asp
|
|
|
|
|
|
Does anybody knows how can i actually access metadata of files?
i am interested in accessing the title and author information stored in word(.doc) files. if you go to the windows explorer and press right click and properties on a .doc file you will see this info.
Thanks in advance
|
|
|
|
|
My mdi app has a navigation screen on the left hand side with link labels that when clicked will decide which form will get displayed on the right hand side. I want to pass a parameter to the eventhandler whenever a link label is clicked but I don't know how to do this. Please, can any one show me how?
So if I have the code below, how can I pass formName to the OnClick method where the formName depends on the link label they click.
public class Home
{
private void InitializeComponenet()
{
button1.Click += new System.EventHandler(OnClick);
}
private void OnClick(string formName)
{
eventHandler(formName)
}
}
|
|
|
|
|
Look at delegates and EventArgs. That will show you how to pass parameters on events.
If you have a main MDI window which creates your MDI child windows and the navigation is a MDI child window that you can only have one of (I am thinking of a left side tab strip type of navigation while the right side hosts all the MDI windows). If this is the case, your main window will have the reference to your navigation window (since it creates it). You could have your main window pass a reference to your navigation window to your MDI children windows. They would then be able to pass the event information directly back to the navigation window would having to raise events.
MainForm
NavigationWindow navWindow = new NavigationWindow();
...
// Some event happens and child window is bring created
MyReportChildWindow child = new MyReportChildWindow(navWindow);
NavWindow
public void OnSpecialClient(string formName)
{
// Do something
}
MyReportChildWindow
private NavigationWindow navWindow = null;
public MyReportChildWindow(NavigationWindow navWindow)
{
this.navWindow = navWindow
}
public OnClicked(object Sender, EventArgs e)
{
navWindow.OnSpecialClient(this.Text);
}
There are other ways to handle this situation. With delegates you will have to have either the Nav window or the Child window know each other in order to register the delegate unless you had the main window set the delegate for the child window when it was created. Would be easier with the above than that.
Another possiblity, is if there will only ever be one Navigation window, you can have it have a static member that you can call from all your child windows. That way you do no thave to pass anything, you could just call NavigationWindow.OnSpecialClient(this.Text) when the event occured. This kind of make the NavigationWindow method global to your application.
Rocky Moore <><
|
|
|
|
|
Thanks for your reply, but I am still not clear on how to implement what I am seeking. I know I have to create a class that derives from the System.EventArgs base class, but I am not sure how creating this class ties in with everything else. For example, where do I instaniate this class, how does that relate to onclick and the type the method takes. Any help is appreciated.
|
|
|
|
|
Hi there,
I have a file called exmple.aspx created in a notepad and it ran well in a IE web browser and i enjoyed the result. But as i want to run it in the visulastudio IDE, i created a project, SampleProject and right click on the project added a webform and named it as exmple.aspx. copied the code from the original file(notedpad) and saved it, tried to run the file by right clicking it and choosing the option 'view in browser' but unfortunately it displayed the following error .
Server Error in '/SampleProject' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'SampleProject.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="SampleProject.Global" %>
Source File: c:\inetpub\wwwroot\SampleProject\global.asax Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
I am new to visualstudio.net and ASP.NET. I am not sure the way i created example.aspx in visualstudio IDE and ran it was correct. Please help me in understanding and how to overcome this problem.
thanks in advance.
dev
|
|
|
|
|
Try compiling the project prior to viewing the page in a browser. When you right click on the page, select "Build and Browse".
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hi friends!
Would someone please tell me what may be the reason for somebody to choose C# instead of VC++ to create windows applications? I think C# is only proper for WEB applications that don't need realtime capabilities.
Does have C# any capability that VC++ doesn't have it?
Your comments will be greatly appreciated
Don't forget, that's <font color="blue">" Persian Gulf "</font> not Arabian gulf!
|
|
|
|