|
Jejeje
Dave: you're right, sorry, that was my mistake, I'll give you the code and the error message.
thanks
|
|
|
|
|
Does the laptop have the .Net framework installed...
|
|
|
|
|
Jejeje
Dave: you're right, sorry, that was my mistake, I'll give you the code and the error message.
EliottA: yes of course the framework is already installed on the laptop.
I'll publish the code , so you can tell me where is the mistake...
thanks
|
|
|
|
|
(I've been through this with someone)
First: Does the laptop have a Serial Port?
Jm
www.menendezpoo.com
|
|
|
|
|
Wow!!!, of course it have one, hey man, I can identify a serial port...
|
|
|
|
|
Great. You have now issued 4 messages on the subject, without providing anything tangible.
Don't write you will provide such and such, just do it.
And show us the exception, i.e. Exception.ToString() that will give a problem description, the
exact location (you did switch on the display of line numbers in your IDE?), and possibly additional
information. Whatever line it points to, show us the method's code.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 11:36 PM
|
|
|
|
|
|
Just post the relavent code and the error message.
I, for one, am not about to download some random thing off the internet - and if I did, I'm certainly not going to go through a whole application's code - unless we discuss $s first of course!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
i need to change text color an item in listview on C#
i can change text color in listview on properties but that change all items in listview
i don't want change text color all items but i need to change an item or some items
how can i do it?
please give some hints or tips to me
thanks a lot....^^
|
|
|
|
|
The ListViewItem item in the Items collection should have a BackColor property which can be set.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
This will colour the first item Red and it's first sub item blue:
listView1.Items[0].UseItemStyleForSubItems = false;
listView1.Items[0].ForeColor = System.Drawing.Color.Red;
listView1.Items[0].SubItems[1].ForeColor = System.Drawing.Color.Blue;
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Here's a posting for a Session class I wrote to easily get and store session-based variables.
Feedback appreciated.
using System.Web;
public class uSess : uSession
{
}
public class uSession
{
public static System.Exception LastEx;
private static object tObj;
public uSession()
{
}
private static T LateCType<T>(object Value)
{
return (T)Value;
}
public static bool getBoolean(string _SessKeyName)
{
bool tBool = false;
tObj = getObject(_SessKeyName);
tBool = LateCType<bool>(System.Web.HttpContext.Current.Session[_SessKeyName]);
if (tObj != null)
bool.TryParse(tObj.ToString(), out tBool);
if (tBool == false)
{
tBool = false;
}
return tBool;
}
public static void setBoolean(string _SessKeyName, bool Value)
{
System.Web.HttpContext.Current.Session[_SessKeyName] = Value;
}
public static string getString(string _SessKeyName)
{
tObj = getObject(_SessKeyName);
string sTemp = "";
if (tObj != null)
{
sTemp = (string)(tObj);
}
return sTemp;
}
public static void setString(string _SessKeyName, string Value)
{
System.Web.HttpContext.Current.Session[_SessKeyName] = Value;
}
public static int getInteger(string _SessKeyName)
{
int iTemp = 0;
string sTemp = getString(_SessKeyName);
int.TryParse(sTemp, out iTemp);
return iTemp;
}
public static void setInteger(string _SessKeyName, int Value)
{
System.Web.HttpContext.Current.Session[_SessKeyName] = Value;
}
public static double getDouble(string _SessKeyName)
{
double iTemp = 0.0;
string sTemp = getString(_SessKeyName);
double.TryParse(sTemp, out iTemp);
return iTemp;
}
public static void setDouble(string _SessKeyName, double Value)
{
System.Web.HttpContext.Current.Session[_SessKeyName] = Value;
}
public static System.DateTime getDate(string _SessKeyName)
{
System.DateTime tDate = DateTime.MinValue;
tObj = getObject(_SessKeyName);
if (tObj != null)
{
System.DateTime.TryParse(tObj.ToString(), out tDate);
}
return tDate;
}
public static void setDate(string _SessKeyName, System.DateTime Value)
{
System.Web.HttpContext.Current.Session[_SessKeyName] = Value;
}
public static object getObject(string _SessKeyName)
{
object tObject = null;
tObject = System.Web.HttpContext.Current.Session[_SessKeyName];
return tObject;
}
public static void setObject(string _SessKeyName, object Value)
{
System.Web.HttpContext.Current.Session[_SessKeyName] = Value;
}
public static System.Collections.Hashtable getHashtable(string _SessKeyName)
{
System.Collections.Hashtable tHash = null;
tObj = getObject(_SessKeyName);
if (tObj != null)
tHash = (System.Collections.Hashtable)(tObj);
return tHash;
}
public static void setHashtable(string _SessKeyName, System.Collections.Hashtable Value)
{
System.Web.HttpContext.Current.Session[_SessKeyName] = Value;
}
public static void SessionRemove(string _SessKeyName)
{
System.Web.HttpContext.Current.Session.Remove(_SessKeyName);
}
public static void SessionClearAll()
{
System.Web.HttpContext.Current.Session.Clear();
}
}
ASPX ~ Apple Simply Performs eXcellently
|
|
|
|
|
document.cookie='chocolate chip=warm';
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
You do realise this is the programming questions forum, we have a different place for articles.
It's not even the ASP.NET forum.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Our software development division has been using a number of programming languages on different platforms including C, C++, PHP, Cold Fusion, C#, ASP.NET, Visual Basic (non-.NET), Perl, on Windows, Linux, and Sun Solaris, etc.
As you can imagine, asking one developer to take over another developer's project can be tricky as he may not possess the required knowledge. There have been discussions in the team lately on what should we do. Our team split into two sides:
(1) must standardize the development tools/environment
OR
(2) only asking each developer to write detail technical documentation is enough
I'm more towards #1 (standardizing tools and environment) using the .NET platform (mainly C#). I believe documentation alone won't help a C# developer to learn Cold Fusion running on Solaris. However, I need some more convincing arguments to help management to make the decision. Don't get me wrong though, I am 100% supporting documentation; I just believe we must also standardize our tools as well.
I appreciate if you can share your experience and/or thoughts on what are some reasons that we should (or should not) standardize development tools and environment.
Thank you all in advance.
|
|
|
|
|
You've pretty much summed it up with point 1. Some other things to consider:
As a business owner, retention and continuity are important to me. If I have a key system developed in language X (running on Operating System Y) then it's absolutely vital that I can continue to have this system supported if the original developer leaves.
I can't target staff training if there are so many different environments in use. It would be next to impossible to prioritise training.
You can't have a long term strategic view if your environments are in complete chaos.
|
|
|
|
|
Pick the correct language or tool for the job. When all you have is a hammer everything starts to look like a nail. If all you are writing is business software then it is an easy decision to force support into one language, one platform, and one skill set. However, if you have a mix of embedded systems, web based systems, weather simulators, and natural language processors VB.NET would be a hard sell.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
Sorry I forgot to mention that. Yes, most of what our division does is developing business desktop and web applications for in-house use. So there is no embedded system development, weather simulator (not sure what is involved anyway), or natural language processors.
|
|
|
|
|
With respect to Weather Simulations I was just trying to pick something that required a massively parallel supercomputer and that was all I could think of.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
Hello,
I am new to this forum and I am a student.My problem is that, I created a MDI Parent application which is suppose to be accessed through login form,I used following code for login to the mdi parent
if (usertxtbox.Text.Equals("admin") && passtxtbox.Text.Equals("admin"))
{
MDIForm1 f1 = new MDIForm1();
f1.Show();
this.Close();
}
else
{
MessageBox.Show("Login Failed");
}
but when I run the application it and insert the correct info the application closes.
After that I thought of hiding the login form instead of closing it by changing
this.Close() to this.Hide() and it worked .
But I had problem when I tried to close the MDI Form using the close button[X] of the form on the top,the form closed but the application was still running in background.
What can I do to solve the problem?
I think I am suppose to implement Threads but how i don't know .
Sorry if I am unable to explain properly,Since its my first time.
Please! Can anyone like to help me.
|
|
|
|
|
Instead of starting the UI thread on login form, use for example MDI parent form as your startup form. When MDI parent starts, launch login and check if it's ok.
Also you can do this in your main class. First use login form, if it's ok, then start UI message loop on MDI parent using System.Windows.Forms.Application.Run(...)
|
|
|
|
|
The common way to do this is to show the form before you call Application.Run, then open up the form. This might end up looking like:
public static void Main()
{
using (LoginDialog dlg = new LoginDialog())
{
if (dlg.ShowDialog() == DialogResult.OK)
{
if (dlg.IsValidLogin)
{
Application.Run(new MDIForm1());
}
else
{
MessageBox.Show("Login failed");
}
}
}
}
|
|
|
|
|
Hello I am coding a data transfer class for my project, in which I am transfering a file peer to peer from one machine to another. Im sending data through sockets and network stream. After syaing that here is my problem, on the client side i have a thread that reads the file converts it to bits and write it to the network stream. On the server side i have another thread listing for incomming connections. when a data transfer command comes it runs a method used to read the data from the network stream. The problem is that sometimes the client dosent have enought time to write the whole file to the stream beacuse the server immedeatly starts reading from the network stream and this is resulting in data being corruted.
My temp solution was to include the following code "Thread.sleep(5000)" before the RecieveData method so the server waits 5 seconds before attempting to read from the stream. This worked but I noticed that if the file size increases dramaticaly 5 seconds is not enough time for the client to write to the stream, is there any mathematical solution that i can use or any other way to maybe work out this problem. Thank you guys
|
|
|
|
|
You shouldn't need to worry about if the server has transferred some or all of the file before beginning your reading. What class and function are you using to receive data, and how are you calling it?
|
|
|
|
|
Hello, to recieve the data i am first waiting for the client to wrie all the data into the stream and then the server connects the network stream to the incoming socket and reads the data. Below i have pasted the code where the server is downloading the data from the client.
if (clientsocket != null)
{
//Retrieve Stream from the socket that is connected to the client machine
NetworkStream incomingNetworkStream = new NetworkStream(clientsocket);
//Output Stream which will be used to store the incoming file onto the machine's HDD
FileStream fsout = new FileStream(parser.TemporaryFilesPath + @"\database.zip", FileMode.OpenOrCreate, FileAccess.Write);
long size = Convert.ToInt64(incomigFileSize);
long rdby = 0;
int len = 0;
if (incomingNetworkStream.DataAvailable)
{
while (rdby < size)
{
//buffer to store a portion of the incoming file
byte[] buffer = new byte[1024];
len = incomingNetworkStream.Read(buffer, 0, buffer.Length);
fsout.Write(buffer, 0, buffer.Length);
rdby = rdby + len;
}
fsout.Flush();
fsout.Close();
isReading = false;
}
else
{
}
byte[] datatosend = Encoding.ASCII.GetBytes("TransferCompleet");
serverSendSocket.Send(datatosend, datatosend.Length, 0);
}
The problem is that sometimes the data isnt read correctly and i think because the client pc is not finsihed writing to the stream when the server starts reading from the stream.
|
|
|
|