|
...
Word.Application w= new Word.Application();
w = (Word.Application) System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application");
MessageBox.Show(w.ActiveDocument.Path);
...
UMS
|
|
|
|
|
Thanks umseker..
It works..
Luck is Opportunity with hardwork
|
|
|
|
|
Hello Everyone:
I am working on an app (windows) in which I need to provide a functionality to create object connectors (using mouse events). Kinda like when you try to make a DTS package in SQL Server you connect two ojbect and it draws a nice graphics to represent the connected objects. Or Table Designer when you try to relate two fields in seperate tables.
Any help will be appreciated. Thanks.
Best Regards,
Robert
|
|
|
|
|
|
Also can you decrypt the content from the database and recreate the file?
thanks in advance.
|
|
|
|
|
|
Hi,
Can you recommend a book on C# 2005 (windows or web) with excel/word please?
I would like to learn programming office applications (excel or word) with c# 2005 (asp.net 2.0 or windows).
Thanks
|
|
|
|
|
|
Does anyone know if there is a way to access command line arguments from one running application in another application. I want to have a windows service that looks for other running apps and runs them when necessary. Sometimes there may be more than one instance running with different arguments, so I need a way to see what arguments the running instance is using. I tried looking at processes that I get when calling GetProcessesByName and then looking at StartInfo Arguements, but it appears to be empty even when I have passed in parameters. I know my parameters have been accepted because I an display them in a message box. Any help on this would be greatly appreciated.
Sean
|
|
|
|
|
Hi guys,
Please I need some help. I am totally lost on this and have used all my thinking power to deal with this issue and no luck. I have an application that uses System.Web.Mail to transmit emails, in every 5-6 emails that go out one stalls giving the above error with inner exception as follows:
The transport failed to connect to the server and sometimes it says The transport lost it's connection to the server.
We have a mail marshal server that also acts as a dummy smtp server to filter the emails and that is where I am directing these emails to. This dummy server acts as a filter to the emails and diverts them to the main email server with a port not 25 hence I can't divert them through that main server. Do you think this could be a problem?
Dummy server is the SMTP server I am using and has a port 25. Our SMTP server configurations are through Exchange.
Please any suggestions will be very helpful.
sasa
|
|
|
|
|
Hi guys, i need to execute such a file and supply it arguments, i've looked around and found the "System.Diagnostics.Process.Start()" method, it works great, but i want controll over the executed application... or at least run it in a minimized window state...
any suggestions?
(The executable is a program written in c)
Thanks in advance,
Erik.
|
|
|
|
|
|
Process proc = new Process();
proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
proc.StartInfo.FileName = "thefile.exe";
proc.Start();
|
|
|
|
|
Thanks guys!
Ok next question... the executable exe file gets input from the user (using scanf)
is there a way to supply it arguments without changing the source code of the executable?
(by changing the main to receive parameters and modifing the source code accordingly)
I guess it has something to to with adding values to the input buffer of that application...?
Thanks in advance,
Erik.
|
|
|
|
|
You can supply arguments to the executable by changing the ProcessStartInfo.Arguments property. Is that what you mean?
|
|
|
|
|
How about:
myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
|
|
|
|
|
Hi all dear friends,
I have a win. service, and I try to read the current user name,
the following methods DONT work, please help.
1. Way : --> System.Security.Principal.WindowsIdentity.GetCurrent().Name;
2. Way : --> Environment.UserName;
these are dont work, becuase, win service run as a account "system" default.
any other ideas ?
Cheers...
|
|
|
|
|
Alper Sümer Güç wrote: these are dont work, becuase, win service run as a account "system" default
Actually, that is showing the correct result. The current user IS "System". Each process running runs in its given security context and as far as the application is concerned that is the current user.
|
|
|
|
|
hi!
ok here's what i want to do exactly:
i want to keep showing the rows with errors and in the same time, enable the user to add and edit other rows.
that's why, i'm asking if there's a way to put a row in an unbound mode ?
thks in advance.
C# is the future, but who can see the future :p
|
|
|
|
|
You can do so, however you must understand the issues in doing so.
When a DataGridView does a refresh, each cell looks to see if it is bound. If it is, then it gets the value from the datatable and refreshes it's data. Now if you have data in an unbound cell, the value is only within that cell itself. If the user sorts your datatable or maybe even does a minimize/maximize, the data contents will be lost.
(A good example of this is adding a checkbox field that is unbound. Check the box and behavior is great. Sort the grid and your selected fields are gone)
You can add rows to your datatable to represent the added fields to bypass these issues....or deactivate these features of the control.
|
|
|
|
|
I want to process a text file line by line. how can i loop through all the line in a text file one by one
|
|
|
|
|
.NET 2.0:
string[] lines = File.ReadAllLines(@"C:\myfile.txt");
.NET 1.1 (directly copied from MSDN):
try
{
using (StreamReader sr = new StreamReader("TestFile.txt"))
{
String line;
while ((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
}
}
}
catch (Exception e)
{
Console.WriteLine("The file could not be read:");
Console.WriteLine(e.Message);
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Hi,
Does anyone know when the .NET 2.0 portal will be available??
Are there any other goof portals out there that I can work though?
I have the code of the following potals:
DotNetNuke
CommunityServer
CommerceStarterKit
Regards
ma se
|
|
|
|
|
hi,
if i press a delete button in parrent form form3 (how is in fact also a child of another form)
i want to get a " are you sure? yer or no " screen so i made this in another form, form5.
if i press no i just close form 5 but if i press yes something in the parent from has to happen.
how do i do this?
how do i make a sort of variable that works for both the forms?
anybody any ideas
links are also helpful
thx
|
|
|
|