|
Hi all,
I'm writing a custom installer app and need to create shortcuts to go in the users startup directory.
I need to know how to create a shortcut file in code, i'm sure it can be done but for the life of me
I can't find anything telling me how.
Please help.
Kev
|
|
|
|
|
You must include a Reference to the Windows Scripting Library. In the Add Reference dialog, click the Com Tab and add the Windows Scripting Host Object Model.
use "using IWshRuntimeLibrary;"
make a shortcut a la
IWshShortcut shortCut = new IWshShortcut_ClassClass();
and start playing
-spif2001
|
|
|
|
|
Sounds good, I'll have a play.
Thanks
Kev
|
|
|
|
|
I am trying to use the new AutoComplete in the the .net framework 2.0 beta and I can't seem to get it to work, I have read the help files on it (man this beta documentation is almost just an ndoc output ) but I couldn't find any reason why it wouldn't work. I set a customCollection of words to match and set the auto complete collection to custom and set the auto complete mode to suggest and append but when I type in the text box nothing pops up. Anyone got any ideas?
|
|
|
|
|
Well I figured it out after a while, auto complete only works with single line edit boxes
|
|
|
|
|
Hi
can someone help me with this article? how do I make it work?
1. Unzip the file to C:\Inetpub\wwwroot\MDSPusher
http://www.codeproject.com/cs/webservices/MdsBlackberryPush.asp
I can send an email to my blackberry email account, I'm looking for better way to automate it.
I didn't have any luck with format my content, is html table working?
thanks
ps. didn't see this forum @ 1st place
|
|
|
|
|
|
are there good book on pushing content to blackberry?
|
|
|
|
|
How can i make my Tree View link like how a navigation bar link.
Example:
Home
- Login
- administrator
- teacher
- student
- ...
(when click Home in the TreeView the page will link to Home)
|
|
|
|
|
Hi
I have doone a program such that using xpath , to read data's from xml and display it on a form.
now for ex:
XPathExpression Expr2;
Expr2 = oXPathNav.Compile("/tmp_day_stats//td_value");
XmlNamespaceManager oxmlNSManager = new XmlNamespaceManager(oXPathNav.NameTable);
oxmlNSManager.AddNamespace("tmp_day_stats", "http://myserver/myschemas/tmp_day_stats");
Expr2.SetContext(oxmlNSManager);
XPathNodeIterator iterator2 = oXPathNav.Select(Expr2);
while (iterator2.MoveNext())
{
this.textBox2.Text.ToString += this.textBox2.Text == "" ? iterator2.Current.Value: "\r\n"+ iterator2.Current.Value;
}
the above program what it does uis that read all the values of td_value from the xml file and display them in the textbox2.
ie, the output is as follows
900909.87887
980126.767
353553.543
776668.6466
now i have to format these numbers as follows
900909.87
980126.76
353553.54
776668.64
ie, after decimal i should have only 2 values to be shown.
how to format it . please help me to get this..
santhosh
|
|
|
|
|
|
Hi
Thanx for ur reply.
But what I need is that , it reads the fiedls values of "td_value" from a xml file and displays data ina textbox. so I dont know what are the values in the xml.
so whatever the values may be, I want to display them with 2 decimal places.
so can u give it in a general way.
ie, not by specifying values
as
string.Format("{0:f2}", somefloat)
the coding is in the above message . pls help me to do this.
john santhosh
|
|
|
|
|
Hello.
I want to get the full path of the file representing the current open Word document.
I was told that this could be done easily with VB by the function getObject, does anyone know of a way to do this in C#?
Thanks..
|
|
|
|
|
Are you saying you want to get the open document itself, or just the path? Keep in mind that Word can have many documents open. You need to get the Word.Application instance from the Running Object Table (ROT). To do that you pass "Word.Application" to System.Runtime.InteropServices.Marshal.GetActiveObject and cast to the ApplicationClass in the Word PIA (Primary Interop Assemblies; these are installed with a development feature of Office 2003 Professional and downloadable for Office XP from http://msdn.microsoft.com[^]. They can also be generated automatically.). Once you've done that you can easily get the active document:
using System;
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Word;
class ActiveDoc
{
const string WordProgId = "Word.Application";
static void Main()
{
ApplicationClass app = Marshal.GetActiveObject(WordProgId)
as ApplicationClass;
if (app != null)
{
try
{
DocumentClass doc = (DocumentClass)app.ActiveDocument;
if (doc != null)
Console.WriteLine(doc.Path);
}
catch (COMException)
{
Console.Error.WriteLine("No document is open.");
}
}
else
Console.Error.WriteLine("Word is not running.");
}
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
[WebMethod]
public ClassBase DoSomething(ClassBase classbase)
{
...
}
[Serializable]
public abstract class ClassBase
{
...
}
[Serializable]
public class PriorClass:ClassBase
{
...
}
[Serializable]
public class NewClass:ClassBase
{
...
}
PriorClass pc = ServiceRef.DoSomething(priorClass) as PriorClass;//works well
NewClass nc = ServiceRef.DoSomething(priorClass) as NewClass;//exception issue
|
|
|
|
|
You cant cross-cast from an instance of PriorClass to NewClass as they are siblings in your inheritance tree.
|
|
|
|
|
sorry, the correct should be:
PriorClass pc = ServiceRef.DoSomething(priorClass) as PriorClass;//works well
NewClass nc = ServiceRef.DoSomething(newClass) as NewClass;//exception issue
|
|
|
|
|
Ok now that looks better... but without knowing what DoSomething does with the argument passed in its hard to advise as to the problem.
A tip for you though.. on the left hand side of that assignment you should be dealing with your base class - all functionality should be abstract within it. In other words your code should look along these lines
BaseClass pc = ServiceRef.DoSomething(priorClass);
BaseClass nc = ServiceRef.DoSomething(newClass);
pc.SomeCall();
nc.SomeCall();
with SomeCall being abstract/virtual in BaseClass, and implemented in the Concrete PriorClass and NewClass.
|
|
|
|
|
Hi everyone,
I'm having a strange problem with unicode encoding in C# / Macromedia Flash, and I think I need a little explanation to make sure I understand WHERE is the problem.
So, in C#, we have Encoding.UTF8 and Encoding.Unicode . Encoding.UTF8 will encode ASCII characters into 8 bits, and all other characters as 16 bits (accented characters, etc). On the other hand, Encoding.Unicode is actually UTF16 and will encode all characters into 16 bits.
The problem: latin small letter s with caron - š - with character code 0x0161. This letter is encoded into 0x6101 when using Encoding.Unicode or 0x0161 when using Encoding.BigEndianUnicode . However, when using Encoding.UTF8 , this letter is encoded into 0xC5A1.
In Macromedia Flash, strings are apparently encoded using UTF8, as the base ASCII characters are encoded into 8 bits, but the small letter s with caron - š - is encoded into 0x0161.
So now I don't know why is it different in UTF8 in C#?
Any clues will be highly appreciated...
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
|
Thanks Mike, this makes sense! Now it seems that the Flash is actually using UTF-16 internally, not UTF-8. I will forward this to our Flash guy.
One more question - is there any easy and straightforward way to convert UTF-16 representation to UTF-8 representation of a letter?
[EDIT]I was thinking about an algorithm, or a simple script, not about the C# Encoding.Convert [/EDIT]
Thanks again!
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Al of you people wil know how to get the position of the mouse pointer in a textBox. But mij problem is i need to get my mouse pointer to a position given in 2 textboxes. Can anyone tell me how to do this because i don't have a clue
The underdog
|
|
|
|
|
Hopefully I got it right that you want to move the mouse cursor to a position, whose coordinates are given in two textboxes.
The following code snippet assumes that only numbers can be entered into both textboxes, cause otherwise the Parse methods might throw an exception.
int x = int.Parse(textBoxX.Text);
int y = int.Parse(textBoxY.Text);
System.Windows.Forms.Cursor.Position = new Point(x, y);
www.troschuetz.de
|
|
|
|
|
Hello C# developers,
I would like to send SMS via my c# code.I am planning to send SMS by using a web site.But how can I provide user name and password for this web site? do you have any sample code for this?
I have made some researches on MSDN web site and all the code samples were about Pocket PC programming.
Can anyone help? How can I do this?
Regards
|
|
|
|
|
I was thinking of creating a simple, specialised task manager. It seems quite easy to use the Diagnostics.Process class to get processes memory and CPU usage.
But I also need to get GDI and USER objects per process. Is there any similar class for that or is it performance counters or WMI I need to look into?
|
|
|
|