|
|
Hi all. I'm sure there are loads of articles and examples on the net for what I'm trying to do but I don't know what you would call it and consequently I'm not sure what to Google for.
I'm trying to simplify a file path to something that will fit into a certain number of characters. I think I can best explain by using an example.
Let's say I have a file path as follows:
C:\Documents and Settings\My Name\My Documents\Work Documents\Business Plan.doc
but I have only limited space to display this path. I'm not overly concerned that the user should be able to read the full path (although I can do that by providing a ToolTip or putting the full path in the StatusStrip or whatever) but I would like for the user to get a general impression of where the path points.
I am in other words looking for a result along the lines of:
C:\Docum...\...\Business Plan.doc
If you have any suggestions for articles or examples on the net that deal with this I'd be happy to hear. Also, the above sample result is what I quickly came up with but there may be more sensible ways of stripping down long paths to something shorter. Please let me know if you have any advice.
|
|
|
|
|
|
Only took me 10 minutes to knock this together - close enough?
<br />
private static string TruncatePath(string path, int chars)<br />
{<br />
if (path.Length < chars)<br />
return path;<br />
string drive = path.Substring(0, path.IndexOf('\\') + 1);<br />
string fileName = path.Substring(path.LastIndexOf('\\'));<br />
if ((fileName.Length + drive.Length) > chars)<br />
return drive + "..." + fileName.Substring((fileName.Length + drive.Length) -(chars + 3));<br />
else<br />
{<br />
return drive + path.Substring(drive.Length, chars - (drive.Length + fileName.Length)) + "..." + fileName;<br />
} <br />
}<br />
It definitely isn't definatley
|
|
|
|
|
Excellent stuff! That's exactly what I had been looking for. It wasn't really necessary to actually go and write the code but I appreciate the effort and your 10 minutes certainly saved me more than just 10 minutes.
I was curious actually whether there wasn't some class in the .NET framework that could achieve this. It turns out there is, TextRenderer.MeasureText and TextFormatFlags.PathEllipsis but that is when you render the text graphically. Your function is simple and elegant and does exactly what I wanted to do.
|
|
|
|
|
Hi.
In a report (rdl) I have a contract text that is about 3 A4 pages.
When I put the text in report, it only fills the odd pages. i.e. for 3 pages it produces 6 pages which pages 2,4,6 are blank.
What should I do to fix this problem?
Best wishes
|
|
|
|
|
What do I need to develop Outlook 2007 add-in using VSTO. I'm using Visual Studio 2005 Professional Edition.
What software/patches/libraries etc are required?
|
|
|
|
|
simple[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Install .Net Framework 3.5 or higher
Ahmed Manzoor wrote: Lol, I didn't find any links on installation...
well well well, you have to read...no body gonna give you an exact thing always as well as you can change the searching text
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Ahmed Manzoor wrote: So I think some thing special is not installed on my PC any clues?
I think I told you about installing .Net Framework 3.5 or higher. Do not avoid things else you're in black hole
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Ahmed Manzoor wrote: What software/patches/libraries etc are required?
It is mentioned in the article in your later posts,
Developing with VSTO requires a version of Visual Studio greater than Express Edition. The current beta of Visual Studio can be downloaded from http:
or at least Outlook 2003 SP1. Be aware that Outlook Express will not function as a replacement for Outlook.
You need VSTO[^] since you already have VS2005. Verify which version you need but, i guess it depends on which office version you have on your machine.
|
|
|
|
|
I installed .NET Framework 3.5, VSTO, I have Office 2007 so for that I installed VSTO SE.
But still it isn't working
|
|
|
|
|
The only thing i suspect is, the app was buil on a beta. and well i have no idea about VSTO 
|
|
|
|
|
|
|
Hi,
Thanks for the links. Got good info from that..
But, I think there is a miscommunication.
The problem I have is that my "send mail" task in DTS is not working because my server does not have a outlook configured.
If there is a way to solve the issue by modifying this package in runtime so as to use my local profile for sending the mail, it would be good.
|
|
|
|
|
Hi All;;
I have An UltraWinGrid Contain 3 Columns (ID,Name,Address), When I Group it By Address
the Grid Epanded one by the address, I Want To Get Number Of Row Under this Grouping,
(Number Of Row For Each Group).
Thanks All
|
|
|
|
|
this[^] is right place to ask this question
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi All;;
I have An UltraWinGrid Contain 3 Columns (ID,Name,Address), When I Group it By Address
the Grid Epanded one by the address, I Want To Get Number Of Row Under this Grouping,
(Number Of Row For Each Group)
By C# Code
|
|
|
|
|
By going to the link in the post you replied to, you are more likely to get an answer. This is because you are asking about a specialist subject, made by another company. Does it not seem reasonable that the Infragistics forum will give specialist help using a product which they designed?
|
|
|
|
|
Using System
Public Class Class1
{
Public Void Hello()
{
Console.WriteLine("base")
}
}
Public Class Class2:Class1
{
Public Void Greet()
{
Console.WriteLine("derived");
}
}
Public Class Demo
{
Static Void Main()
{
Class1 c1= new Class1();
C1.hello();
Class c2= new Class2();
c2.hello();
c2.greet();
Class1 c3=new Class2();
c3.hello();
}
}
when i am trying to run tis project in command prompt it is showing the followin error
error cs2001:sourcefile inh.cs could not be found
fatalerror cs2008:no inputs specified
|
|
|
|
|
you have to compile the cs file before run...
csc inh.cs
then
inh
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|