|
Take a look at the System.IO.Path class which has a static method to do exactly what you want.
|
|
|
|
|
Excellent! Thanks Jamie, perfect.
|
|
|
|
|
Have a look at the System.IO.Path class.
---
b { font-weight: normal; }
|
|
|
|
|
hi
if some one knows the code for thinning of a image?
|
|
|
|
|
|
reducing the pixels of a image into a single pixel
|
|
|
|
|
s4_sabahatf wrote: reducing the pixels of a image into a single pixel
You're kidding, right?
|
|
|
|
|
|
Hey guys,
A few days back i was using some application and I noticed a control which i had never seen before - it looked a like regular checkbox control but it had a tick mode and a cross mode. When in the cross mode a red color X would appear in it? I have only seen checkboxes that can be ticked or unticked but not of this kind. Ufortunately i forgot the name of the software In which i saw this! Anyone know where i could get a similar control for my C# app?
|
|
|
|
|
hi
What is Callback and how to use it ?
and how to use IAsuncResult for Update UserInterface(ProgressBar) to show Completing operation ?
thanks .
|
|
|
|
|
callback would be a method that is called when the operation completes.
|
|
|
|
|
Here is the situation..I have a word document in the database which i access and open to show it to the user.
I do it by creating a new process and then open the file.. now i want to check if the winword application is already open and i want to get its process id...
can anybody help me with this..
Ameet
|
|
|
|
|
Simple,
Process [] processes = Process.GetProcessesByName("winword");
then iterate through all the elements in the array, get their process ID(s). Like this:
<br />
foreach(Process proc in processes)<br />
{<br />
int pid = proc.Id;<br />
<br />
}<br />
Hope it helps.
|
|
|
|
|
Any light shed on this problem would be greatly appreciated. I am trying to consume a webservice from a C# windows application using a webClient. I am passing a string formatted XML via a webClient.UploadValues in the values. When i try to access the webservice i am not getting access and instead am getting dumped out with a Internal Server Error 500
|
|
|
|
|
That means that the server returned the error code HTTP 500 as there was an error when the web service was executing.
Is the XML that you are sending a proper SOAP message? Browse to the url of the web service to see an example of what the service is expecting.
---
b { font-weight: normal; }
|
|
|
|
|
What is being passed is a string built from an XML document which has been read from an upload. This string does not contain a SOAP header but overloaded method exists to handle different input types (including a string) to the same webservice. The webClient call isnt getting as far as the webservice i suspect as the server is returning the 500 error. I've been looking online and see lots of reference to IIS settings. Have you encountered anything like this at any time???
Sorry i cant be any more informative than this.
System.Collections.Specialized.NameValueCollection values = new System.Collections.Specialized.NameValueCollection();
values.Add("StringXmlInstruction",XMLTextFeed);
Console.WriteLine(XMLTextFeed);
byte[] btResponse = webClient.UploadValues("http://dev003/lmsHIPInstruction/instruct.asmx", "POST", values);
|
|
|
|
|
Hello all, I am trying to add several items to a dropdown menu and have hit a brick wall.
I have a list of people and I am trying to add a button for each person into the dropdown menu. But I can't get it to work. Any help or ideas?
Also how do I add an event to each button so I can get it to do something when I click on it?
Thanks in advance,
Phil
"Rules are for the obedience of fools and the guidance of wise men"
|
|
|
|
|
Phillip Hodges wrote: But I can't get it to work.
What does that mean? Show the code you've got till now, so we have an idea how far you've come and what still needs to be done or changed.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
mycombo.Items.Add("SomeText");
and just doubleclick the button in your designer.
Hope this helps.
|
|
|
|
|
Have a look at Link Buttons. If the list of names is done on the fly add a unique ID to each LinkButton. This should help if i have got the idea of what you are asking
LinkButton yourButtonName = new LinkButton();
yourButtonName.Command +=new CommandEventHandler(yourButtonName_Click);
private void yourButtonName_Click(object sender, CommandEventArgs e)
{
}
tlab
|
|
|
|
|
I think you might want to reply this to Phillip Hodges who is in need of this answer :->.
|
|
|
|
|
Sorry my bad, Is that my brain sleeping? I think it is!
|
|
|
|
|
Have a look at Link Buttons. If the list of names is done on the fly add a unique ID to each LinkButton. This should help if i have got the idea of what you are asking
LinkButton yourButtonName = new LinkButton();
yourButtonName.Command +=new CommandEventHandler(yourButtonName_Click);
private void yourButtonName_Click(object sender, CommandEventArgs e)
{
}
tlab
tlab
|
|
|
|
|
Dear all,
If for example I am trying to make a custom folder explorer (to display PSP film names correctly) and I am using a TreeView to display the folder hierachy.
Is it possible to access the system icons for example the currently used Folder icon from the Shell to use??
Many thanks
Paul
ps VS2005 and C#
|
|
|
|
|
for getting file icons you need to use shell APIs. you can use the following snippet.
[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public IntPtr iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
class Win32
{
public const uint SHGFI_ICON = 0x100;
public const uint SHGFI_LARGEICON = 0x0;
public const uint SHGFI_SMALLICON = 0x1;
[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
}
IntPtr hImgSmall;
string fName = "c:\\getfileicon.cs";
SHFILEINFO shinfo = new SHFILEINFO();
hImgSmall = Win32.SHGetFileInfo(fName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON |Win32.SHGFI_SMALLICON);
System.Drawing.Icon myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);
imageList1.Images.Add(myIcon);
I think this code would be helpful.
Saqib
|
|
|
|