|
To get the path of your executable:
System.Reflection.Assembly.GetEntryAssembly().Location
Then just get the directory with System.IO.Path.GetDirectoryName(), and use System.IO.Path.Combine() to tack on the PDF filename.
(Better to use System.IO.Path than string parsing, to make sure it'll work regardless of the location... forward slashes / backslashes, etc)
|
|
|
|
|
Use the code below. Application.StartupPath gives you the path of executable
Process.Start(Application.StartupPath + @"\sample.pdf");
|
|
|
|
|
Or you could try this: (assuming the PDF file will always be in the same directory as your application executable)
Process.Start(Environment.CurrentDirectory + @"\file.pdf");
Hope this helps.
Regards,
Jason Pezzimenti.
If you liked the answer that I have provided, then please click the 'Good Answer' link on the bottom-right of this post. Thank you.
|
|
|
|
|
i have devloped windows application
i want to create linces key
and user should enter key while setup
and also how do i specify the duration like trial version for 1 month
|
|
|
|
|
Licensing systems are a little more complicated than just setting a few properties, unfortunately...
A couple quick searches, and I found an article here on CP that might help you:
Using XML Digital Signatures for Application Licensing[^]
If that's too advanced, you might be better off going with a third-party solution... There are some out there... Just google for "C# licensing system"
|
|
|
|
|
im having a hard time coding a simple calculaor especially on its buttons function.everyone willing to help me?...tanx!looking forward to your help.
|
|
|
|
|
So what about your homework project specifically are you having a hard time with?
|
|
|
|
|
Can you be more specific about the problems you are having. I'm sure then people are more pleased to help.
I think you should not expect someone to do all the job for you.
|
|
|
|
|
Search the articles; there are all too many simple calculator articles here.
|
|
|
|
|
Hi
i want to inject code into .net assemblies. for this, i found some useful tools such as Reflexil that can some changes to an assemblies limited, but u can not add more class or change an existing properties of that assemblies.
Is there any better tool or way to accomplish this ?
thanks
|
|
|
|
|
What is your intent? I am asking you since you have went to extremes like Reflexil.
|
|
|
|
|
i want to analysis some our applications and it's security leveles.
i don't want to make virus, .... it's only for testing.
if u can't help me, plz don't post
|
|
|
|
|
Cool down, Use your energy to solve the problem. Try Mono Cecil. You can edit IL, add\remove functionality and do more.
|
|
|
|
|
Hi,
My application contains several forms and if any of them shows MessageBox i can't close other forms normally. Forms works normally but i cant use close method at all, only dispose() method works. please help!
James Hunt
|
|
|
|
|
Close them like this
Form.Close();
remember that the Form should be an object of your form.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
MessageBoxes are Modal Forms, you cannot move to another Form in the same application while they are showing!
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 have a situation when i have to move to another form in the same application while messageBox is showing.
I do it by using SetForegroundWindow method.
|
|
|
|
|
Yes you can do it programatically, but not manually, as far as I know anyway.
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.”
|
|
|
|
|
If you're showing a MessageBox, then you have a modal window in operation. This needs to be dismissed before your application can receive user input again.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
that is exactly the purpose of a modal dialog: you have to provide some information or consent before the app can continue. That is how most apps force you to answer "Do you want to save your document?"when you click the close box or the exit menuitem while your document holds unsaved data.
Other forms can be shown "modeless" meaning they don't insist on keeping your atention. For forms you choose between Show() and ShowDialog(), the former is modeless, the latter modal. However MessageBox is always modal.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hi every
i have a report with crystal report that have some unbound field
how can i bind to a table this unbound field
Thanks a lot
|
|
|
|
|
why do not answer my overlord?
|
|
|
|
|
I'm working on windows application.I need to find out the number of bold letters available in the Word document.
I have used name space Microsoft.Office.Interop.Word to read the word document and also tried with some of the properties like Selection,Range to find whether the character is in bold or not but no result.
I have read each character by reading the content of document and checking its format but here while reading the text the character is missing its Format.
I have also tried by converting it into html format and tried by using HTML Element Collection but it is unable to read/recognize the bold tag.
Please give the solution to count the bold letters of word document.
Thanks
|
|
|
|
|
Hope this code helps
Document doc = ac.Documents.Open(ref oldFileName, ref m, ref readOnly,
ref m, ref m, ref m, ref m, ref m, ref m, ref m,
ref m, ref m, ref m, ref m, ref m, ref m);
int count = 0;
for (int i=1;i<= doc.Content.Characters.Count;i++)
{
if (doc.Content.Characters[i].Bold == -1)
{
count++;
}
}
MessageBox.Show(count.ToString());
|
|
|
|
|
Thanks for replying to my post.
It is not working as it is displaying the total no.of characters of the word document.
I think while reading the characters from the word document it is removing the font formatting and then reading the characters with normal font.so unable to find the bold letters.
Please Suggest the solution.
Thank you
|
|
|
|