|
private void SayHi(params string[] s)
{
// ...
}
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
If you want to send an array, you have to create an array:
SayHi(new string[] { "Hi","Cpian!" } );
If you use the params keyword, the parameters sent to the method will become an array:
private void SayHi(params string[] str_In)<br />
<br />
SayHi("Hi","Cpian!");<br />
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I'm new to C# and the whole server/client thing, as an exercise I've made a simple board game for two players, now I'd like to make it playable on the net which is obviously not a trivial task (for me anywayz). I was looking for SIMPLE tutorials or articles about creating a web servers and clients, but havnt found anything basic enough - I need an example of client and server passing very basic pieces of data (strings?) on simple events between them, but the articles I've seen deal with more complex project. A point in the right directon would be very appreciated, thanx.
|
|
|
|
|
Remoting is an easy way of getting data flowing between the server and the clients.
Take a look at MSDN http://msdn2.microsoft.com/en-us/library/ms973857.aspx[^] or CodeProject http://www.codeproject.com/csharp/dotnetremotingbasictutor.asp[^]
Try creating two custom objects that you use as communication channels.
Let the server expose it's serverchannel object through remoting, and when client contacts the server through the channel, it can register the client and set up a remoting connection back to the clientchannel object, which the client exposes through remoting aswell.
You can put appropriate communication and game methods in these channels aswell as events which you can monitor.
-Larantz-
-- Modified --
If you choose to go for a remoting solution where both sides expose a marshalled (remoting) object, remember to have each side set up their own remoting servers before they try and contact the other side. Otherwise the attemt at setting up local remoting server will fail as the remoting proxy from the otherside blocks the local server from being set up correctly.
|
|
|
|
|
Thanx will try that tomorrow when I can have both my eyes looking in one direction btw, gotta love your signature
|
|
|
|
|
sqlite[^] is very good it's 1 dll (well in its pure native form) and then 1 db file per user if thats the way you want it
not sure how it'd handle that much data but it's worth a look.
You still use ado.net to "connect" to it but it local and file based rather than network based.
|
|
|
|
|
Thank you )
Looking in to it now! *Does a dance*.
jeremy
|
|
|
|
|
without importing from win32 dll-s
or how do I communicate with a device with C# build in classes.
Does C# has something like this ? classes for registering/unregistering a service, and communicating via IOCTL's
thank you
B.Gabriel
|
|
|
|
|
euacela wrote: without importing from win32 dll-s
Use DeviceIoControl without using Win32?? Impossible. You have no choice but to import the function calls.
euacela wrote: how do I communicate with a device with C# build in classes.
That depends entirely on the device in question, but if it's not connected to a Serial Port, you don't. There are no classes native to the .NET Framework that deal with device communication, like USB, PCI, low level disk/volume work, ...
euacela wrote: classes for registering/unregistering a service
Yes, this is built into the .NET BCL. I believe it's the ServiceInstaller[^] class in the System.ServiceProcess namespace.
euacela wrote: communicating via IOCTL's
No, this is NOT in the .NET BCL.
|
|
|
|
|
Hi
In my program a have a series of images that i would like to save as an animated gif. Is this possible in c#, im using visual c# express ed. If not how easy/hard is it to save images into a windows movie file if at all possible.
Many thanks.
|
|
|
|
|
This will help you: http://www.codeproject.com/dotnet/NGif.asp
As for movie, you will need DirectX as I guess but I'm not sure as I'm not experienced in that field
|
|
|
|
|
Hi,
I want to check that any of the property on from related to controls is changed or not.
How can i do it in C#.
Plz mail as soon as possible.
Amit Verma
73amit@gmail.com
|
|
|
|
|
Hello,
i have a problem with retrieving a jagged array from my webservice the array looks like this:
Array ( [0] => Array ( [0] => id [1] => int(11) [2] => YES [3] => [4] => ) [1] => Array ( [0] => name [1] => varchar(255) [2] => YES [3] => [4] => ) )
SyncITSoap SyncITSoap = new SyncITSoap();
object columns = SyncITSoap.getColumns("", "", "syncit","test");
error message when the methode is called getColumns = {"The specified type was not recognized: name='Columns', namespace='http://server.e-ss.nl:8100/service', at <columns xmlns=''>."}
can somebody help me out? thx in advance
wdsl is this:
WDSL Jagged array problem
<?xml version="1.0" encoding="utf-8"?>
<definitions
name="SyncIT"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://server.e-ss.nl:8100/service"
xmlns:tns="http://server.e-ss.nl:8100/service"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema targetNamespace="http://server.e-ss.nl:8100/service" xmlns:impl="http://server.e-ss.nl:8100/service" xmlns="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Database">
<xsd:all>
<xsd:element name="name" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="DatabaseArray">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:attribute foobar:arrayType="tns:Database[]" ref="soapenc:arrayType" xmlns:foobar="http://schemas.xmlsoap.org/wsdl/"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Table">
<xsd:all>
<xsd:element name="name" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TableArray">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:attribute foobar:arrayType="tns:Table[]" ref="soapenc:arrayType" xmlns:foobar="http://schemas.xmlsoap.org/wsdl/"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Columns">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:attribute foobar:arrayType="xsd:string[]" ref="soapenc:arrayType" xmlns:foobar="http://schemas.xmlsoap.org/wsdl/"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ColumnArray">
<xsd:complexContent mixed="false">
<xsd:restriction base="soapenc:Array">
<xsd:attribute foobar:arrayType="tns:Columns[]" ref="soapenc:arrayType" xmlns:foobar="http://schemas.xmlsoap.org/wsdl/"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</types>
<message name="getDatabasesRequest">
<part name="login" type="xsd:string"/>
<part name="password" type="xsd:string"/>
</message>
<message name="getDatabasesResponse">
<part name="databases" type="tns:DatabaseArray"/>
</message>
<message name="getTablesRequest">
<part name="login" type="xsd:string"/>
<part name="password" type="xsd:string"/>
<part name="db" type="xsd:string"/>
</message>
<message name="getTablesResponse">
<part name="tables" type="tns:TableArray"/>
</message>
<message name="getColumnsRequest">
<part name="login" type="xsd:string"/>
<part name="password" type="xsd:string"/>
<part name="db" type="xsd:string"/>
<part name="table" type="xsd:string"/>
</message>
<message name="getColumnsResponse">
<part name="columns" type="tns:ColumnArray"/>
</message>
<portType name="SyncITPort">
<operation name="getDatabases">
<input message="tns:getDatabasesRequest"/>
<output message="tns:getDatabasesResponse"/>
</operation>
<operation name="getTables">
<input message="tns:getTablesRequest"/>
<output message="tns:getTablesResponse"/>
</operation>
<operation name="getColumns">
<input message="tns:getColumnsRequest"/>
<output message="tns:getColumnsResponse"/>
</operation>
</portType>
<binding name="SOAP" type="tns:SyncITPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getDatabases">
<soap:operation soapAction="urn:syncitsoap#getDatabases"/>
<input>
<soap:body use="encoded" namespace="urn:syncitsoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:syncitsoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="getTables">
<soap:operation soapAction="urn:syncitsoap#getTables"/>
<input>
<soap:body use="encoded" namespace="urn:syncitsoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:syncitsoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="getColumns">
<soap:operation soapAction="urn:syncitsoap#getColumns"/>
<input>
<soap:body use="encoded" namespace="urn:syncitsoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:syncitsoap" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="SyncITSoap">
<port name="SyncITPort" binding="tns:SOAP">
<soap:address location="http://server.e-ss.nl:8100/service/service.php"/>
</port>
</service>
</definitions>
|
|
|
|
|
How to create region in C#
Assaf
|
|
|
|
|
Region myregion=new Region();
|
|
|
|
|
Region can be created easily
u can use the following code
#region "TestRegion"
Codes - Methods and functions
#end region
Gokul - MCSD:MCAD:MCP - Technical Lead - GFT INDIA
|
|
|
|
|
hi everyone I want to export data on my form that I got from a database to excel, I am working in C#. I have checked an example on code project but it doesnt help me. Thanks
|
|
|
|
|
|
thank you but isnt there an easier way? I dont want to work with xml files. thanks again
|
|
|
|
|
You can use excel object library to convert the generated file to excel native format
|
|
|
|
|
I dont know how to do that sorry Im still new with programming so I dont know alot can you maybe send me some code if its possible please. Thanks again
|
|
|
|
|
You can use that article to generate xml file and then convert it to xls using this piece of code:
<br />
private void savetoexcelformat(string currentpath, string pathtosave)<br />
{<br />
object missing = System.Reflection.Missing.Value;<br />
<br />
Excel.Application app = new Excel.Application();<br />
app.Visible = false;<br />
<br />
app.Workbooks.OpenXML(currentpath, missing,missing).SaveAs(pathtosave, Excel.XlFileFormat.xlWorkbookNormal, missing, missing,<br />
missing, missing, Excel.XlSaveAsAccessMode.xlNoChange, missing, missing, missing, missing, missing);<br />
app.Quit();<br />
<br />
}
|
|
|
|
|
Thanks for your help Ill try that. kind regards
|
|
|
|
|
The leave event occure when i push the tab button
What happen with me is when i put the first digit the leave event is called
this the code:
private void txtNewExpDate3_Leave(object sender, EventArgs e)
{
string val = this.txtNewExpDate3.Text;
if (this.txtNewExpDate3.TextLength.Equals(1))
this.txtNewExpDate3.Text = "0" + val;
}
and the MaxLength for the txtNewExpDate3 is 2
I do the same code is the same event in other textbox and it work properly.
Thanks in advance
Assaf
|
|
|
|
|
Hi Assaf
I tried to recreate the bug you stated...but on my machine the code given by u works just fine..i.e. only when u press "TAB" key, does the leave event fire and not in any other case..please retest your code.
thanks and regards
|
|
|
|