|
Hi all
I want transfer images and rtf pdf any data formats from one computer to other.
how can I do this.
and clipboard content from one system to other.
thanks
prabhakar
|
|
|
|
|
prabhakar26 wrote:
want transfer images and rtf pdf
You can use the MemoryStream object..here is a snippet of my code.
MemoryStream _ms = new MemoryStream(aArray);
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf1 =
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
_ms.Position = 0;
//before desralizing it write the buffer content to it
_recieved = bf1.Deserialize( _ms );
//once its deseralize call the getobjecttype
//and instantiate the object accordingly
this.GetobjectType( _recieved );
|
|
|
|
|
how can i load data from database to the treeview
|
|
|
|
|
It depends by what datas you have to add
you have to create nodes and add at everyone the data of database but it depend by what datas you have
|
|
|
|
|
Hi all,
I am writing a software that allow dynamic pluging of additional components
(dlls) into the major system by C# on .Net. in runtime.
I want to ask for runtime, can I plug c# classes instead of dll into the main program ? Why I asked this is that I found to dynamic plugging many
small units into the main program, if these units are in form of dll, this
will require long long time to compile in VS.Net(as there are many projects by the dlls).
Or in other view, can I inject c# classes in a dll dynamically in runtime ?
Thanks
|
|
|
|
|
Dear Sir. or Miss,
Now I like to use C# program to modify tnsnames.ora content using
the related methods provided by system lib.
For example, after a client accepts the related values , such as
"zgafc", "109.52.8.8", "1521" and "db.source", then the client can modify (or insert) the file "tnsnames.ora", as following :
ZGAFC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 109.52.8.8)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = db.source)
)
)
then the client can access the db by "zgafc" in client program.
that's to say, if the client just install the oracle client, and do not
config the source in client, however, it can access the appointed database
after the client accept the values related to connection.
If we can find the methods, we can create the database source in client by program, rather than config the datasource in client by manual.
|
|
|
|
|
hi,
i want to know any method to implement #define similar thing in C#. i need to declare some const like below in C++
#define STATUS_A 'a'
currently, i used
public const char STATUS_A = 'a';
or
enum STATUS
{
A = 'a';
}
apart from above methods, any other method?
thanks,
jim
|
|
|
|
|
You already found it. C# doesn't support compiler directives.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Not quite.
You can use defines in C# as well, although not exactly like in C/C++.
You _can_ define symbols at the very beginning of a C# file (before any using directives) or in the project settings in VS.NET.
In your code you can use #if, #elif, #else and #endif and some other preprocessor directives to compile or not compile part of your code, depending on the symbols you define. MSDN has a list:
C# preprocessor directives[^]
Regards,
mav
|
|
|
|
|
My bad! :-> I could have sworn that it didn't. This topic came up before about 6 months ago and I thought that was what the answer was.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello..
i want to use checkbox in datagrid and i want to check all and get all selected columns?
and also want to change selected column background..
tell anybody what is the procedure?
|
|
|
|
|
I'm looking for a way to delete a single XmlElement from a document.
I'm using the following to add an element:
<br />
XmlNode node = KatalogForm.configDoc.DocumentElement.SelectSingleNode("categories");<br />
<br />
XmlElement newCat = KatalogForm.configDoc.CreateElement("category");<br />
newCat.InnerText = addNewCategoryTextEdit.Text;<br />
node.InsertAfter(newCat, node.LastChild);<br />
KatalogForm.configDoc.Save("katalog.config");<br />
But I can't find a comparable RemoveElement() or DeleteElement() or some other XmlDocument member method.
Does anyone have any ideas?
thanks all
|
|
|
|
|
|
ok makes sense, but I need to delete the element who has a specific value, for instance, the line in the xml file contraining the value comboBox.SelectedItem. The format of the xml file looks something like
<configuration>
<categories>
<category> blah 1 </category>
<category> blah 2 </category>
</categories>
</configureation>
so I can't just RemoveChild based on the node name.
|
|
|
|
|
So you'll have to develop a algorithm that searches your XmlDocument for the nodes that match your criteria. This shouldn't be too hard
Everytime you found one, delete it with following cde snippet:
XmlNode nodeToDelete, parentNode;
parentNode = nodeToDelete.ParentNode;
parentNode.RemoveChild(nodeToDelete);
www.troschuetz.de
|
|
|
|
|
ok hehe, thanks a lot for your help.
I'm thinking I need to something to the effect of:
<br />
if(node.InnerText == ComboBox.SelectedItem)<br />
{<br />
}<br />
|
|
|
|
|
|
ok so I've done some thinking about this and here's what I've come up with. The XML file followed by Psuedo code followed by the code.
XML FIle:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<categories>
<category>Operating System</category>
<category>Productivity</category>
<category>Entertainment</category>
<category>Games</category>
<category>Misc.</category>
</categories>
<disk_numbers>
<disk>001</disk>
<disk>002</disk>
<disk>003</disk>
</disk_numbers>
</configuration>
Psuedo Code:
start in parent node "categories"
for each child node it has named "category"
check if innerText is equal to the selected item in the combo box
if it is
remove the child node
if it isn't
go to the next child node
during one pass through the child nodes this can never fail since the combo box item wouldn't be
listed if it wasn't in the file
Code:
private void mainToolbarRemoveCategoryButton_ItemClick(object sender,
DevExpress.XtraBars.ItemClickEventArgs e)
{
XmlNode parentNode = configDoc.SelectSingleNode("/configuration/categories");
if(MessageBox.Show("Are you sure?", "Katalog", MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation) == DialogResult.No)
{
return;
}
else
{
foreach(XmlNode n in parentNode)
{
if(n.InnerText.ToString() == programCategoryComboBoxEdit.SelectedItem.ToString())
{
try
{
parentNode = n.ParentNode;
parentNode.RemoveChild(n);
configDoc.Save("katalog.config");
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}
So hopefully it's obvious what I'm trying to do, I guess the foreach loop is where the issue is, is this how I would traverse each child node?
thanks!
|
|
|
|
|
you should use the removeChild(xmlNode) method of xmlDocument or xmlNode
|
|
|
|
|
Evertime i try i get this exception.
System.InvalidOperationException: There was an error reflecting type 'serialize.UserControl1'. ---> System.NotSupportedException: Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface.
|
|
|
|
|
not everything in dot net is serializable you should be able to find info on what is and isnt on msdn
|
|
|
|
|
Serializing an UI control directly doesn't make sense. Better aproach is to put all your data in a simpler data structure like dataset or array.
No one ever became great by imitation.
Samuel Johnson (1709-1784)
|
|
|
|
|
Well i was thinking for the sake of recreating bugs that happen on other peoples computers, how cool it would be to recreate the environment as much as possible.
Also i got another weird problem. After making functions to serialize and deserialize a test class i made...I decided to make that class extend control because i figured, the error messages only told me this in an inner exception:
<codecannot serialize="" member="" system.componentmodel.component.site="" of="" type="" system.componentmodel.isite="" because="" it="" is="" an="" interface.="">
So i did this to smack the xmlignore property on their:
[XmlIgnore]<br />
public override ISite Site<br />
{<br />
get<br />
{<br />
return base.Site;<br />
}<br />
set<br />
{<br />
base.Site = value;<br />
}<br />
}
and the exception message is unchanged.
|
|
|
|
|
Well i was thinking for the sake of recreating bugs that happen on other peoples computers, how cool it would be to recreate the environment as much as possible.
Also i got another weird problem. After making functions to serialize and deserialize a test class i made...I decided to make that class extend control because i figured, the error messages only told me this in an inner exception:
Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface.
So i did this to smack the xmlignore property on their:
[XmlIgnore]<br />
public override ISite Site<br />
{<br />
get<br />
{<br />
return base.Site;<br />
}<br />
set<br />
{<br />
base.Site = value;<br />
}<br />
}
and the exception message is unchanged.
|
|
|
|
|
Arg! i tried overrided every public member in control and putting the [XmlIgnore] tag on them, and same error message...
|
|
|
|