|
Can you give me an example or refer me to one ?
C.R.E.A.M
|
|
|
|
|
|
Hi,
I have two parameters as follows:
string scriptText = MsgBox "hello";
string MachineName = "targetMachineName"
I would like to create a file called sample.vbs which will have the scriptText in it.
This file will have to be saved in the c directory of the MachineName.
How is this done please?
Thanks
|
|
|
|
|
File.WriteAllText ?
What have you tried ? What is the target machine, is it on your network, and if not, how is it your target ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I think this is to do with the streamwriter or something similar.
Target machine is any machine on the network.
Thanks
|
|
|
|
|
File.WriteAllText with a network path, if you have access to the machine. If you don't, then you don't, no matter what.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I didn't realize it was that simple.
Many thanks
|
|
|
|
|
helo every body! (Sorry, english of my bad!)
I want make a program Dictionary, i use one table have 3 two field: words, mean and pronoun. Please tell me the way. thank you very much!
|
|
|
|
|
Well, you could read this[^].
Apart from that, if you have your table layout, the next thing you need is typing. Lots, and lots of typing.
What answer were you hoping for ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
You could maybe use a dictionary, using the word as the key and a definition class instance as value?
Something like:
public class Definition
{
public Definition(string meaning, string pronoun)
{
Meaning = meaning;
Pronoun = pronoun;
}
public string Meaning { get; private set; }
public string Pronoun { get; private set; }
}
Dictionary<string, Definition> definitions = new Dictionary<string, Definition>();
public void AddDefinition(string word, string meaning, string pronoun)
{
definitions.Add(word, new Definition(meaning, pronoun));
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
you can use .netframwork generics or extended generices called powercollection.
|
|
|
|
|
i use Visual C# t build this project.
|
|
|
|
|
I want make a program Dictionary, i use one table have 3 two field: words, mean and pronoun. Please tell me the way. thank you very much!
|
|
|
|
|
Please edit your posts instead of creating new ones.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
we know that there are at least two ways to convert a string to a number, let's say, int:
int.Parse('100')
convert.toInt32('100')
I also read from one book that Convert is at cost of some performance. why? does it mean that it is better to use .Parse() instead of using Convert?
thanks!
|
|
|
|
|
If one were "better" than the other, one of both would be obsolete
If the value you're converting is NULL then Parse [^] will throw an exception, while ToInt32 [^] sets it to the number "0".
I are troll
|
|
|
|
|
OK, I agree your comments,but I concern mainly that which one is more performance efficient, espeically when such function is
used lot of times.
|
|
|
|
|
You should really only ever use TryParse unless you're *certain* there's a number in there. Both operations are costly, they both involve parsing the string and turning it into a number.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
Convert.ToInt32 is slower because it additonally checks the null value which int32.parse does not do. Checkout the Int32 function returned by .NET Reflector:
public static int ToInt32(string value)
{
if (value == null)
{
return 0;
}
return int.Parse(value, CultureInfo.CurrentCulture);
}
Convert.ToInt32 also uses int.parse internally. So int.parse is better as far as the performance is concerned. but it may throw exceptions if string value is not specified or an empty string is specified etc. I hope it helps.
Regards
Saank
Either you love IT or leave IT...
|
|
|
|
|
Great, thanks, this is what I want!
|
|
|
|
|
Great to know that this is what you wanted.
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
Hi,
I wan't to create a timer that starts at a given time! The start time will be set in a configuration file in a format HH:MM. After that the timer shall fire off with given intervals. The interval is configured in my configuration file in fomration HH:MM.
How can I do that?
/Håkan
|
|
|
|
|
What have you tried ? Amusingly enough, you will need a timer to check for the right time to start your actual timer, but beyond that, I don't see how this is at all hard.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Look at the System.Threading.Timer class.
You can specify an interval before the first execution and an interval between subsequent execution.
Keep in mind that the Timer class uses TimeSpans and not DateTimes. If you want to use specific times, you can do something like that:
DateTime startDate = DateTime.Today;
startDate.Hour = startHour;
startDate.Minute = startMinute;
TimeSpan interval = new TimeSpan(intervalHour, intervalMinute, 0);
Timer timer = new Timer(MyTimerCallback, null, startDate - DateTime.Now, interval);
|
|
|
|
|
Hello, I've been messing around with some code for a long time and haven't been able to figure out how do to this.. I've messed around with the System.Drawing.Bitmap, and bitmap graphics...
What I need is to get all of the images from a video file (i can do this myself, unless it's super easy to render every frame of an avi file?) and place each image on one large bitmap. Each image has to be converted to a power of 2 dimension (256x256, 512x256,1024x512, etc) and placed 1 blue pixel apart.
Here is an image example..
First image,
|
|
|
|