|
Hi
I'd like to know how I can open a file on the harddisk via code.
I mean opening the file in a new instance of its default associated program in windows (for example an .xls file in Excel,
not opening it via code to read from it.
thanks in advance
greetings pdluke
|
|
|
|
|
Process.Start
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
After updating a row in the datagridview, the grid is re-populated. How is it possible to make the current cell the one that was just updated. Please note that if there are many records in the grid, and say record no 380 was updated, then the grid should move the pointer (current cell) to that row.
Thanks
|
|
|
|
|
Hello, I have in my interface a button, "startButton" and a richtextbox "TextOutput", when I clik the startButton I want view in my richtextbox the content of a file "contload.txt" (which is in "c://") ...can you help me please
lavy
|
|
|
|
|
Hi,
you can do this like that
<br />
TextOutput.Text = System.IO.File.OpenText("C:\\contload.txt").ReadToEnd();<br />
hope this helps you
greetings pdluke
|
|
|
|
|
|
hi..
i want to serialize a Hashtable to a XML file..
how to do this..
currently i m using List<> to store objects, and serializing the List<> and its working fine..
but how to serialize a Hashtable.. plz help me..
regards,
nas
|
|
|
|
|
Hi
as far as I know it's not possible to serialize a Hashtable.
I had the same problems some time ago.
You could use the Dictionary<> which is in .NET 2.0, I think.
It has the same functionality as the Hashtable.
greetings
pdluke
|
|
|
|
|
try this:
Hashtable.GetObjectData Method
|
|
|
|
|
i have tried it but it is not possible using hashtable.
till i send you code which i have tried.
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Collections;
namespace HAshxml
{
[Serializable]
public class test
{
public int height;
public int length;
public test()
{
Console.WriteLine("Inside test parameter less constructor");
}
public test(int x,int y)
{
height = x;
length = y;
Console.WriteLine("Inside test constructor");
}
public void GetObjectData(SerializationInfo info,StreamingContext context)
{
Console.WriteLine("Inside Get object data");
}
}
public class Program
{
static void Main(string[] args)
{
test t = new test(10,20);
Hashtable ht = new Hashtable();
ht.Add("h", t);
Stream str = File.OpenWrite("D:\\abc.xml");
//BinaryFormatter formatter = new BinaryFormatter();
XmlSerializer ser = new XmlSerializer(typeof(test));
ser.Serialize(str, ht);
str.Close();
//formatter.Serialize(str, ht);
//str.Close();
//XmlTextWriter xl=new XmlTextWriter (
Console.ReadLine();
}
}
}
|
|
|
|
|
I need to change a combo box so that when the user uses autocomplete and the item is not found, the wrong item is not selected when he presses tab.
Any ideas ?
Johan Lombaard
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former - Albert Einstein
|
|
|
|
|
Try checking the current value in the ComboBox with the FindStringExact() method in the Lost focus event of the Combo.
|
|
|
|
|
Hi,
I am writing a program to set up a serial port communication.
I'm doing this with SerialPort sp = new SerialPort (); and then SP.Write();
But I can only write a string format to the port. But I want to write a byte to the port. does anyone knows if this is posible and how to do this?
thanks.
|
|
|
|
|
-=gix=- wrote: does anyone knows if this is posible
Yes
-=gix=- wrote: and how to do this?
This's long to be posted here, try searching articles instead.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Method write is overloaded.
Write(string text);
Write(byte[] buffer, int offset, int count);
Write(char[] buffer, int offset, int count);
|
|
|
|
|
I made a byte[] array in stead of a normal byte and is seems like its working!
|
|
|
|
|
In the ITypeDescriptorContext object passed to the EditValue method of UITypeEditor (i.e. the first parameter - nominally referred to as "context") there's a method member called GetService.
This is NOT to be confused with the GetService method available from the second parameter which is of Type IServiceProvider, it's parameter name being nominally "provider".
My question is twofold a) where is the ServiceCollection that presumably lies behind this method and b) how do I put things in it - Component & IComponent don't seem to provide a ServiceCollection, and if I endow my component with IServiceCollection it doesn't seem to connect with the ITypeDescriptorContext.GetService method, which never seems to be anything but null.
NB : As far as I can tell the only thing one can get from the provider.GetService is an IWindowsFormsEditorService object.
I'm working around this by putting an extra object into the attribute collection that provides yet another GetService that IS backed up by a ServiceCollection, the class also exposes the AddService and RemoveService methods.
|
|
|
|
|
Hi all,
i need to select a node in a treeview after selecting from a combobox
i.e. the treeview displays the same information as the combobox and i need to check the corresponding node selected from the combo into the treeview
thanx alot
|
|
|
|
|
switch (YourTreeView.SelectedNode.Name.ToString())
{
case "FirstNodeName":
...
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
hye
i already use portaccess.output in my program
but now,i try to use portaccess.input in my program
unfortunately,i dont know how i can use portaccess.input
please help me guys
thanx
|
|
|
|
|
Please don't ask again, edit/reply on your existing thread.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i am creating a C# application,the main form has a background image.
i want to put another panel on top but it should be trasparent.
i want to see the back ground image.
how can i make the panel trasparent?
My small attempt...
|
|
|
|
|
Set the panel background color to transparent should do the trick
|
|
|
|
|
but i tried that. but i didnt work
My small attempt...
|
|
|
|
|
i removed the panel and added the label
but the samething happening i cant change it to transparent.
there is an option in backcolour to set transparent but it shows a gray colour only
My small attempt...
|
|
|
|