|
Hi
Look at the Socket.Receive and Socket.Send methods in the MSDN - they provide sample code for point-to-point connection transfer (TCP). One machine does Send/Recv and the other does Recv/Send.
Socket.ReceiveFrom and Socket.SendTo demonstrates datagram connectionless transfer (UDP). One does Send only and the other does Recv only.
The sockets buffer has a limited size typically max 64KB with UDP and much less for TCP, so with file transfers you will have to send it bit-by-bit, so you'll have to define a protocol that includes information such as 'this is block 1 of 23', and collate this on the receiving end into a single file.
You will also have to consider what happens if you miss a block - ie. wait for the next cycle, etc.
HTH
Martin
|
|
|
|
|
Hi
In c# program What you should do is store the field (i.e column name)of a xml schema file in an array . Then while looping thru’ your input name (a xml file say "first.xml" with a single column name same as the name as in the schema) you should find out where this column name lies in your input file (i.e the index. Could be 4th one). Then update the output file accordingly(write that column values from the xml file into the output xml file).How to do this. a coding help pls
ramyaa
|
|
|
|
|
Hi guys,
I'm really struggling with a problem I'm having with a datagrid.
Basically, I download a log of alerts in the form of an xml document and load them into a datagrid, all in string format.
The problem is that when I display the form the first cell in the grid is always selected. What I am looking for is some way of making the grid unselectable, or even just a way to deselect the cell when I display the form.
I am using a DataTable called alerts with 3 DataColumns called date,url and notes. This is the constructor code
InitializeComponent();<br />
date = new DataColumn("Date");<br />
date.ReadOnly = true;<br />
url = new DataColumn("URL");<br />
url.ReadOnly = true;<br />
notes = new DataColumn("Notes");<br />
notes.ReadOnly = true;<br />
<br />
alerts = new DataTable("Alerts");<br />
alerts.Columns.Add(date);<br />
alerts.Columns.Add(url);<br />
alerts.Columns.Add(notes);<br />
<br />
dataGrid1.DataSource = alerts;
I then have a test method in place to fill the grid
<br />
public void SetTestList()<br />
{<br />
for(int i=0;i<20;i++)<br />
{<br />
alerts.Rows.Add(new string[]{"Test "+i,"Test "+i,"Test "+i});<br />
}<br />
<br />
this.Refresh();<br />
}
Anyone have any ideas what I can do to sort this problem out?
Cheers
Mike
|
|
|
|
|
Hi,
I have written a word automation application in c#, using the 2003 word object model 11.0. I have tested it on my system and it works fine. When i copy the EXE and required dll's on to another system, i get a System.UnauthorizedAccessException. Considering that all i have written is a windows form, that attemps to create a word object and open a document, this is pretty unexpected. This exception occurs on creating the object itself.
But when i add the user with permissions to the DCOMCNFG Default Access, then i am able to create the word object. But on my own system the code works fine without the settings. Can anyone help me out here!!
Thanks and Regards,
Laks
Not everything that can be counted counts and not everything that counts can be counted
|
|
|
|
|
My application logs its operation into a file.
As part of the application when an exception is thrown I am logging the exception.
The log shows the whole exception stacktrace and message in English and it’s fine.
However, when the application is installed on Russian Windows the exception messages (not the stacktrace) is logged in Russian.
How can I cause the exception to be written always in English?
I know that when I change the Thread.CurrentThread.CurrentUICulture to of the thread to CultureInfo.InvariantCulture just before the exception is thrown then the exception message is in English even on the Russian machine.
This solution forces me to change the CultureUI of the all the threads on creation and it’s not nice solution.
Ami
|
|
|
|
|
Hi!
How can I get the versionnumber of an assembly ?
|
|
|
|
|
try this:
using System.Reflection
...
string s = Assembly.GetExecutingAssembly().GetName().Version.ToString();
U can use other calls than GetExecutingAssembly if u whant other assemblies.
|
|
|
|
|
Hi all,
i want to merge two images in c#.net.please help me .
rathish
|
|
|
|
|
Hi all,
I am new to XML. I am trying to fill a Dataset with the help of XML. But what I want to do is to verify the data against an XML schema file(XSD file) and then fill it in the Dataset. Is it possible. If yes can anyone help me please.
|
|
|
|
|
I have creatd a webpage using C# in asp.net
I have a close button with which i want to close the webpage as soon as i click on it
is it possible using C#?
Sukanya
|
|
|
|
|
I am so poor in thin client application. So i can't able to help you in C#. But at the same time you can meet your goal using JScript. I know this is not an exact answer for your queary. But this is alternative for your queary.
<br />
<body><br />
<script language=jscript><br />
function CloseMe()<br />
{<br />
close();<br />
}<br />
</script><br />
<form id="Form1" method="post" runat="server"><br />
<button id="btn" onclick="CloseMe();"/><br />
</form><br />
</body>
Sreejith Nair
[ My Articles ]
|
|
|
|
|
AFAIK this can't be done with ASP.NET cause it's a server side technology. So you have to use script code like the one provided in the previous answer.
Besides, the ASP.NET forum is a more suitable place for questions like this.
www.troschuetz.de
|
|
|
|
|
Hi folks,
Is C# is suitable for real time image processing.... ?
comments plz...
|
|
|
|
|
|
I’m writing a distributed app. I have a web service and windows form. In my form I have declared an instance of the web service like so:
WindowsForm.localhost.service1 ws = new WindowsForm.localhost.service1();
The web service has a web method that sets a string and another web method that retrieves it. The string (m_word) is initialized to “ “ (space).
This is what I’m trying:
Some button event handler ()
{ ws.SetString(this.textbox.text); }
Other button event handler()
{ this.Lable1.text = ws.GetString(); }
What I’m expecting to happen it the word from the text box will appear in the lable but it doesn’t. Its as if I’m typing this.
Some event handler()
{
WindowsForm.localhost.service1 wsA = new WindowsForm.localhost.service1();
WsA. SetString(this.textbox.text);
}
Some other event handler()
{
WindowsForm.localhost.service1 wsB = new WindowsForm.localhost.service1();
this.Lable1.text = wsB.GetString();
}
I know this is a bit cryptic so if any one need clarification let me know. I think I’m missing something about how web services’ live.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
My understanding of your problem is this:
in the first event, you are creating a webservice object wsA, whose string variable you set to a particular value.
But then when you call the function GetString() its on an entirely new object of the webservice class.So technically you should get " " back as the result.
You need to use the same instance of the class to persist the value.
So instead of creating a new object of webservice class, call the GetString() on wsA instead of wsB.
HTH
Cheers!
<bold>Looney Tunezez
"If you build it....
.....BUGS will come!" -JB
Application.Run(new Form1(this.Dispose())); <--WHAT :wtf::confused::eek:
"Stability. What an interesting concept" - Chris Maunder
<bold>
|
|
|
|
|
Yeah I got all that. In the first part of my question I said that I have a global Web service declared and I’m using it in my functions but when I use it from two function calls It looks like I’m getting two different instances of the web service.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
Can you post the code for the web service class? Maybe something is wrong in there?
|
|
|
|
|
Hi,
Web services are stateless, they don't preserve information across method calls. If you want to preserve state, you need to implement your own mechanism, like passing around a session key..
Regards
Senthil
|
|
|
|
|
I am a VB programmer new to C# and I can't seem to find a simple way of raising an event. What I am trying to do is raise an event from one class that will update a progress bar on the main form.cs. In VB this was rather simple, declare the event and then raise it. So far, all of the examples I have seen in C# seem to be pretty involved or don't fully explain what is being done. Is there anyone here that can give me a brief sample with an explanation of what is going on?
|
|
|
|
|
|
I followed the example provided above and I think I understand it a little better. However, I am still not sure how you raise an event in one cs file, for example, process.cs to update something on the form in the form.cs file. The above, and all other, examples I have seen all show the event method overides in one cs file, the listener code and actual code that triggers the event in the main or form.cs file.
|
|
|
|
|
Jk published in his weblog(JKOntheRun) an article about the problem that maybe the new Windows Media Player 10 and the new "playsforsure" Features will never be available for actual Windows Mobile 2003 Pocket-PCs... thats a thing I am also worried about these days - because why the hell did I spent more than €600 for a device, with more than adequate memory capacity for all types of media, when it does not integrate in the existing "Media-World" that is drawn by available and upcoming Microsoft Products. Well have a look at the portable MediaCenter Devices... neat and really cool gadgets - a must have - you can sync them with your home pc´s - you can have the movies from your home´s MediaCenter on your portable MediaCenter, you can buy content from Microsofts Content-providing Partners... okay thats cool isn´t it. - But infact - I got that nifty "all-in-one device suitable for every purpose" called Pocket PC.... - Iam watching high-quality-mpeg4 movies on my PocketPCs for months... I listen to my mp3´s, ogg´s, aac´s and whatsoever... but those cool integration-feeling doesn´t come up with my PocketPC... and the Windows Media Player 10 for Windows Mobile would help that a bit - but what would sort things out: to have the same integration and Features that are available for other, compared to the Pocket PC dumb, devices....
And that´s why I started the "MTP-over-IP" Project. Because MTP is the Protocol all this cool devices use to communicate with the Applications... (there are some more like auto-discovery and so on...but first things first)... a working Implementation of MTP would make it possible that the Windows Media Player 10 on the PC could recognize the Pocket PC as a Media Device, as a Smart Device that it is...
So. Due to quite heavy workload I have the moment I cannot do such a project alone - so I would like to ask everyone that is interested and capable of helping me with this project in doing so.
At the moment the first lines of code are already written - I started the MTP Library in C# based on the .NET Framework at the Moment - the goal is to get the MTP Protocol working, on the .NET Framework and on the .NET Compact Framework...
I published the first lines of code some days ago... you can grab it here (sorry that the blog-article is mainly in German...)
Some links to the source: http://maniac.rz.tu-ilmenau.de/schrankmonster/PermaLink,guid,bc4f4294-54bc-4675-87c3-a8c892ab4b3d.aspx[^]
|
|
|
|
|
Any ideas to the question above? i can make the form appear but there are a few problems to note.
1. The mouse does not draw on the form that appears on top of the app.
2. you cannot move the form around or else the backround will 'brake up'
The app is full screen (non-exclusive although i would like it to work with exclusive). How do i have to setup my direct draw drawing methods to work when this form i being draw? the code im using to make the form is just a test code basicly this: Form f = new Form(); f.ShowDialog();
Thanks alot for your time.
|
|
|
|
|
I don't know exactly what controls there are included but if you get the new SDK (December 2004 update) there are form type controls included with directX. I know there are text boxes, buttons, labels etc but i've notlooked into it in any great detail yet but you may be able to find what your looking for there.
Kev
|
|
|
|