|
Greeeg wrote: Is the MSDN really so hard to read?
No it isn't. Have you read it?
System.IO.Path.GetFileName
only two letters away from being an asset
|
|
|
|
|
So what? Both solutions will work.
My point is that it can't be so hard to open up the MSDN (local or online), go to the string or IO members and look if there's a function that fits my needs.
Nichts für ungut
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You're solution will work, so long as the path seperatation character is a backslash. This is not always the case and is not platform-independent. Using the correct method, pointed to by Mark, will work no matter what the platform or seperation character happens to be.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i am sorry but i really have not time to read it.Thank's for help
when i want to read something good just seat and type it
|
|
|
|
|
papa80 wrote: i am sorry but i really have not time to read it.
That's funny!! Looking it up on MSDN, or hitting F1 in Visual Studio, probably would have taken you 3 minutes to find the answer. How long did it take you to post the question on CP and wait for answer?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
string file = System.IO.Path.GetFileName(path);
|
|
|
|
|
I have a work flow management application for a publishing company. On projects with many contributers they use this application to manage all the submission. Sometimes a submission gets sent back to the author to be rewritten, in this case the document is to be attached to the email. I can get it attached and everything works ok, but in the email it has the generic icon and I have reports of it being labeled as an unknown file type. Once I save the document the proper icon appears and everything. Is there a way to set mime type so that it will appear properly in the attachment? Here is the code:
existingAssignment.Push(Convert.ToInt32(ddlCon.SelectedValue), "A", base.uid, dueDate);
Assignment currentAssignment = this.thisArticle.GetCurrentAssignment();
Contributor auth = new Contributor(this.thisArticle.AuthorID);
msg = new MailMessage(Session["ProjectEMail"].ToString(), auth.EMail);
msg.Bcc.Add(Session["ProjectEMail"].ToString());
msg.Subject = this.tbSubject.Text;
msg.Body = this.tbComment.Text;
msg.IsBodyHtml = false;
MemoryStream st = new MemoryStream(currentAssignment.FileBlob);
Attachment att = new Attachment(st, currentAssignment.FileName);
msg.Attachments.Add(att);
SmtpClient mail = new SmtpClient();
mail.Host = "localhost";
mail.Send(msg);
|
|
|
|
|
eggsovereasy wrote: I can get it attached and everything works ok, but in the email it has the generic icon and I have reports of it being labeled as an unknown file type.
I'm sorry, I guess I still don't understand. Where does this icon show up, and where is it generated from?
|
|
|
|
|
Well on my computer, in outlook I get it. The IT people messed up my office by installing Office 2000 over Office XP so I assumed it was an issue with my computer, but now I am getting some reports from other users.
The icon should just be placed on a .doc by the shell.
|
|
|
|
|
In C++ there are the following macros that can be put into strings....
__FUNCTION__ = Returns the current function that "__FUNCTION__" is in. Example "int Foo(int&,CString&)"
__FILE__ = Returns the current file that "__FILE__" is in. Example "C:\main.cpp"
__LINE__ = Returns the current line that "__LINE__" is in. Example 935
Is there something similar in C#?
Thanks Chris
|
|
|
|
|
chris175 wrote: Is there something similar in C#?
There isn't. However, you can retrieve some of this information programmatically. For example, you can retrieve any information about the current function using System.Reflection.MethodInfo.GetCurrentMethod() .
As far as the other things, regarding the file and line of code, there's nothing that can be retrieved programmatically, AFAIK, because once compiled, the file and line information is gone. The only way you could get this is by looking through you're application's PDB debugging database.
|
|
|
|
|
Hello!
I'm trying to create a custom-drawn toolstrip progress bar. The code looks like this:
public sealed class CustomProgressBarEx : ToolStripProgressBar
{
protected override void OnPaint(PaintEventArgs e)
{
}
}
The new paint method is called, but anyway the control still looks like a standard progress bar.
Any idea how to implement this? How can I draw the progress bar myself?
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
Hi All,
How would one loop a list view? and then after i've done what needed to be done with the item in the listview, move to next item...
i've started like this...
for(int a = 0; a < lvName.Items.Count(); a++)
{
}
Am i starting off correctly?
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
That's correct.
Another nice way is to use this:
foreach (ListViewItem item in lvName.Items)
{
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you.
I did not know you could use "foreach". I'll try it now.
Thank you once again.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi, What do you call each item? is it the selected items?
because i need to assign the id of the client to a variable?
_CustomerID = lvName.SelectedItems[0].SubItems[2].Text.ToString();
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
NarutoFan#1 wrote: Hi, What do you call each item? is it the selected items?
This will iterate trough all items. You can also iterate though all selected items:
foreach (ListViewItem item in lsvReplay.SelectedItems)
{
item.SubItems[2].Text;
}
modified 12-Sep-18 21:01pm.
|
|
|
|
|
how can i create a mobile application in C# and what are the requirements
for any mobile application in C#?
|
|
|
|
|
yousufzai khan sanga chal day. Mobile applications lug the distributed systems background ghawari.
U will be using vs.net. Create new project C#->mobile device->pocket pc or smart phone etc.
you will be using the .NET compact framework. You will also be using the device emulator provided with vs.net during debuging ur software befor deploying to the real device.
Basic understanding of .net remoting,xml webservices,sync and async interaction is required.
i hope u will get start.
If u have further queries contact me at iqazi@gamesnetwork.net
ihtesham
|
|
|
|
|
iqazi wrote: Basic understanding of .net remoting,xml webservices,sync and async interaction is required.
These are NOT required to build a mobile application. They may be used, depending on the requirements, but again NOT a requirement for building any application.
only two letters away from being an asset
|
|
|
|
|
He has not asked how to build a mobile app. but still i showed him the way to create a mobile application.
if u open ur eyes and see the last sentence of his message, he is asking that what is the requirement and i told him that basic understanding of the above technologies is required. So i answered him right one or the other way.
If you having nothing to post, then dont try to do so either.
ihtesham
|
|
|
|
|
required != beneficial
modified 12-Sep-18 21:01pm.
|
|
|
|
|
iqazi wrote: He has not asked how to build a mobile app.
how can i create a mobile application in C# and what are the requirements
for any mobile application in C#?
iqazi wrote: if u open ur eyes
iqazi wrote: basic understanding of the above technologies is required
iqazi wrote: Basic understanding of .net remoting,xml webservices,sync and async interaction is required.
Again, what you mentioned are NOT requirements for any application.
iqazi wrote: If you having nothing to post, then dont try to do so either.
Good advice, take it yourself
only two letters away from being an asset
|
|
|
|
|
The first step is to not ask the same question multiple times. Look at the replies to your first posting.
only two letters away from being an asset
|
|
|
|