|
Has anyone worked on the concept of printing labels in microsoft word by taking c# as front end and access or excel as the back end...
Regards..
Amrit
|
|
|
|
|
Hi!
Can i send multiple files using the same tcp connection when using TCPClient and TCPListener classes!? I have made client and server part of app, and seems to me that everything is working fine on the server side, but when i try to send the second file through the same connection, i get the error:
"An unhandled exception of type System.InvalidOperationException' occurred in system.dll"
Additional information: Operation not allowed on non-connected sockets!
The code from client send button is:
...
private void buttonSend_Click(object sender, System.EventArgs e)
{
Stream fileStream = File.OpenRead(textBoxFile.Text);
byte[] fileBuffer = new byte[fileStream.Length];
fileStream.Read(fileBuffer,0,(int)fileStream.Length);
networkStream = soket.GetStream(); <- here rises the exception
networkStream.Write(fileBuffer,0,fileBuffer.GetLength(0));
networkStream.Close();
this.label2.Text = System.DateTime.Now;
}
...
When i erase the networkStream.Close(); line, i can send multiple files, but the network stream is never closed, so the file on the server side is always in use and i can`t do anything with it!
Thanx for help!
|
|
|
|
|
eyej wrote: Operation not allowed on non-connected sockets!
When you close the stream the underlying socket is closed. You could connect a second time to send the second file, or, you could introduce a protocol into the application that provides for sending two files.
Do you have any previous experience with TCP application protocols? If not you should read up on them. Some simple ones are SMTP and POP3.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
eyej wrote: networkStream.Close();
You should do that at some other stage, or reopen and close the TCP connection every time, it depends really on your requirements of the application what option you choose.
|
|
|
|
|
Well, i am trying to add a voice clip sending in my messenger app! Same as voice clip sending in MSN Messenger 7.5 and 8! So, it would not be a very good idea to make a new connection everytime a user would like to send a voice clip, because the TCP handshaking period is about couple of seconds and above! It would be much annoying for user to wait that time period!So.. i thought i could open one TCP connection when the application is starting, or when the user click "connect" button and send all voice clips through the same connection! Of course, in both directions! Any help please! How do you think this would be the best to do?
Thanks!
|
|
|
|
|
hi i want to embedd or bind any file to my app in runtime and extract it at run time again( for example i want that user can embedd or bind access db into my exe file or extract it again at run time) how to do that ??
codeproject is best ..
thanks
|
|
|
|
|
Would you explain it more. If you want the schema of an Access DB file then you can use OleDbSchemaGuid.
Saqib
|
|
|
|
|
no i don't want embedd only access db into my app, i want to embedd any file to my app or bind it to my app.(for example i want to bind an exe file to my app).
|
|
|
|
|
With binding what do you exactly mean, like what would you take or give to that bound file.
Saqib
|
|
|
|
|
with binding any file to my app at runtime i wnat that end user bind any file such az exe or bmp or ... bind or embedd to my app that other can not access it .
|
|
|
|
|
I've created a customized control that is basically a textbox with some labels. Among other things, I'm trying to expose a couple attributes of the textbox (called myText).
Within the class of the user control, I've put
<br />
public bool Multiline<br />
{<br />
get { return myText.Multiline; }<br />
set { myText.Multiline = value; }<br />
}<br />
This is all fine, and I can modify this within code, but how do I get this property to show up in the properties window in the .NET designer? Is there some special tag I need to put before it?
|
|
|
|
|
That's all you need, if you want to set the description (displayed at the bottom of the property grid) then use the [Description("Your description")] tag, likewise there's a category attribute (when the property grid is in the category view) and a few others such as designer (not applicable to this property).
But basically any property is by default displayed in the property grid. To hide it use the [Browsable(false|true)] attribute.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Turns out all I needed to do was re-open the designer where I was trying to use the custom form. That got it showing up. Anyways, thanks for the help, and the advice on [Description()]
|
|
|
|
|
hi Drew McGhie!
basically, your code is already fine...
maybe the "myText" textbox is not initialized? if the initialization of this textbox was done on the InitializeComponent method... there would be no problem. perhaps you do the initialization by demand?
hope this helps!
microsoc
|
|
|
|
|
I am trying to parse a email message retrieved using POP3 to extract the subject, the sender, the date and the subject. Do you know a certain open source library or code to help me do that in c#.
|
|
|
|
|
I also have the same proble but this code will help you some what....
Pop3Message msg2 = obj.Retrieve(msg);
Response.Write("Message {0}: {1}");
Response.Write(msg2.number);
Response.Write("aashu1");
//int i = msg2.message.IndexOf("Content-Disposition: inline");
//int j = msg2.message.Substring(i).IndexOf("------=");
//int k = msg2.message.Substring(i).Length;
//int p = k - j-1;
string str1 = Regex.Match(msg2.message, "\nTo <to>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
string str2 = Regex.Match(msg2.message, "\nFrom <from>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
string str3 = Regex.Match(msg2.message, "\nCC <cc>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
string str4 = Regex.Match(msg2.message, "\nSubject <subject>[^\n]+)\n", RegexOptions.IgnoreCase).Value.ToString();
int h = msg2.message.IndexOf("\n\n");
string str5 = msg2.message.Substring(h+4);
Response.Write(str1);
Response.Write(" ");
Response.Write(str2);
Response.Write(" ");
Response.Write(str3);
Response.Write(" ");
Response.Write(str4);
Response.Write(" ");
Response.Write(str5);
Response.Write(" ");
Response.Write(" ");
Response.Write(" ");
Response.Write(" ");
aashutosh tiwari
|
|
|
|
|
[VS .NET 2005] i want to add by code an image into resource library starting by the path of the image... how?
|
|
|
|
|
You cannot add an image into the resources (.resx) of an application without recompiling the whole thing, AFAIK. This is because embedded resources are actually compiled into the target app.
Perhaps if you describe what you're trying to accomplish, we might be able to help you find an alternative solution.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
i do that to load an image and set as background for a panel, but it works on my pc where i have got the images then if i run it on another pc it doesn't show background image couse they aren't on the other pc, so i've think to move it into resource:
[EditorAttribute(typeof(MyFileNameEditor), typeof(UITypeEditor))]
[Category("Image state"), Description("Mouse over image")]
//[DefaultValue("")]
public string MouseMovePath
{
get
{
return MouseMove_path;
}
set
{
try
{
MouseMove_path = value;
FileStream fs = new FileStream(MouseMove_path, FileMode.Open, FileAccess.Read);
move = Image.FromStream(fs);
fs.Close();
this.Invalidate();
}
catch
{
MouseMove_path = "(none)";
}
}
}
|
|
|
|
|
|
try this :
http://www.aisto.com/roeder/DotNet/
Use Resourcer. You can add image to resource file.
|
|
|
|
|
Concerning: C#, OdbcDataReader, MySQL, MyODBC
I've built a service which every x seconds performs a series of checks and if they all validate true, it launched a conversion which takes up to 20 minutes.
While converting the service still performs these checks every x seconds and that's all good )
So now I've got like a two-threaded monster; one performing checks while the other is performing a conversion.
ENTER THE PROBLEM:
I'm using MySQL as the database. I use MyODBC to establish the connection and the OdbcDataReader to read my recordsets. OK! The database connection can only have ONE active OdbcDataReader at a time and now my two-threaded monster gets conflicted.
Queries from the checks can't access the database while the conversion has an active OdbcDataReader and even worse the conversion sometimes fails because of the checks |
I've built a simple MySQL class with the methods:
open(...)
query(...)
close(...)
Which I pass round to all the objects (I tried creating new instances each time and I got the MAX Connections Exception'ish Error).
Is there anyone out there who can help my out of this hole I've seem to have dug myself into?
It isn't supposed to be easy, if you know what I mean
|
|
|
|
|
You have two problems:
1. You are trying to share a database connection between threads.
2. There is some database object that you are not closing properly.
Don't try to share the connection. Give each thread a connection on it's own. Actually, don't even hold on to the connection when you don't use it.
Remember to close database connections and datareaders when you are done with them. If you don't, the connection will remain open, and you'll run out of available connections.
---
b { font-weight: normal; }
|
|
|
|
|
hi,
i am programmatically creating a TableLayoutPanel to display some stuff in a windows form. i would like to make the background color different for every other row. does anybody know how to manipulate the colors of a TableLayoutPanel?
thanks,
RC
ps. sorry if this is on the wrong discussion board. i wasn't sure where to put it...
|
|
|
|
|
Hi I am making a program in Visual studio 2005, but I have run in to a problem. The compiler will not accept the following line of code:
string[] strsplit = strFileName.Split(new Char[] {'\'});
The compiler will however accept this line of code:
string[] strsplit = strFileName.Split(new Char[] {'2'});
So the problem must be the “\” character. Is there anyone who knows how to make the compiler accept this specific character?
Nick_L
|
|
|
|