|
DougW48 wrote:
have always used Parse, such as UInt32.Parse(string); instead of Convert,
Convert is safer than parse IIRC, in the sense that it wont throw an exception. Could be wrong
top secret xacc-ide 0.0.1
|
|
|
|
|
You're probably right, I've never used Convert. Thanks!
|
|
|
|
|
Error 1 Cannot implicitly convert type 'uint' to 'string'
It still says that even if I had it like DougW48's example... I don't know can this be a bug since I'm testing out Visual Studio 8 2005 beta 1
|
|
|
|
|
NVM I got it, anyways Thx for the quick help I got at codeproject, will be visiting this site more often;P
|
|
|
|
|
Hello,
i am developing a web service in c# and i have the following problem. The requests and the responses are signed with CAPICOM.SignedData, when the server receives the request and verify the signature, he builds a response which is serialized and signed before going to the client. When the client receives the response, the signature is correctly verified, but when the data are going to be deserialized comes the exception InvalidaCastException (when i try to cast the object returned bu the formatter to the data type defined in a separated class).
Thank you in advance for your help!
|
|
|
|
|
Just an idea. You probably checked this already.
Make sure that both your webservice and your client reference the same library (data type that is serialized). Make sure that you have identical version of the libary on both the client and webservice.
|
|
|
|
|
Could we see some code? probably the entire function that includes the part where InvalidCastException occurs?
|
|
|
|
|
Hi
How can I replace the Task Managar with another Task Manager.
I mean, when I press Ctrl+Alt+Delete my Task Manager opens.
Thanks
Mohammad-Reza Taikandi(HM)
|
|
|
|
|
Ctrl+Alt+Delete is a special key combination that cannot be intercepted (at least on NT). On windows 9x branch it might be possible but i haven't checked.
I strongly recomend against replacing anything that is considered standard windows UI, unless you are trying to do something that is specifically designed to modify the entire user experience.
|
|
|
|
|
Hi
I try to execute an *.exe file that i renamed it to *.sec unfortunately
Process.start() method can't execute it.
Is there any other way to do this?
Thanks
Mohammad-Reza Taikandi(HM)
|
|
|
|
|
Of course *.sec is not going to execute. Its not a executable extension.
Another way to do this would be to rename the filename part instead of the extension. ie Myprogram.exe to abcdef.exe or myprogram.sec.exe
|
|
|
|
|
Hi I have a text file with the following layout:
[PROFILE1]
SYSTEM=home
DEBUG=true
[PROFILE2]
SYSTEM=laptop
DEBUG=true
What I want to do is insert a new line after the FIRST DEBUG LINE in PROFILE1 so the whole of PROFILE2 then moves down a line. My problem is that I keep overwriting the start of PROFILE2 e.g
[PROFILE1]
SYSTEM=home
DEBUG=true
testline
2]
SYSTEM=laptop
DEBUG=true
Can you take a look at my code and see what I am doing wrong!!
if( File.Exists( "d:\\networld.ini" ) )
{
long lFilePos = 0;
string sLine = null;
FileStream fs = new FileStream("d:\\networld.ini",
FileMode.Open, FileAccess.ReadWrite);
// Create a new streams to read and write to the file
StreamReader sr = new StreamReader( fs );
StreamWriter sw = new StreamWriter( fs );
while( sr.Peek() > -1 )
{
sLine = sr.ReadLine();
if( sLine.CompareTo( "[" + "PROFILE1" + "]" ) == 0 )
{
lFilePos = sLine.Length;
while( sr.Peek() > -1 )
{
sLine = sr.ReadLine();
lFilePos += sLine.Length + 2;
if( sLine.CompareTo( "" ) == 0 )
{
fs.Seek( lFilePos,SeekOrigin.Begin );
sw.Write( "testline\r\n" );
sw.Flush();
break;
}
}
}
}
sr.Close();
fs.Close();
MessageBox.Show( "Finished Writing To File." );
}
Thanks a million.
|
|
|
|
|
Why would not you consider the old fashion way read the old file and create
simultaneously a new file -> copy each line while they are identical, then insert the change and so on. When you finish you can delete the old file and rename the new file to the old name. You can use File class. I think it will save you much trouble
DavidR
|
|
|
|
|
IrishSonic wrote:
Can you take a look at my code and see what I am doing wrong!!
You are doing nothing, you are just using it wrong. Best would be to read the file into a stringbuilder instance and just insert the text, then just rewrite the file. There is no point in doing it directly in the file, because your data cannot be "shifted" forward. Imagine trying this (what u wanna do) on a 1Gbyte file....
top secret xacc-ide 0.0.1
|
|
|
|
|
Ok guys, comments definitely taken on board!!
But can't believe that if you want to insert a new line at a specific point, it means rewriting the file to a new file and deleting the old one.
Is this the industry standard way its always done??
So what if I wanted to just update a line?? Would I still have to write to a new file and delete old??
Also could I trouble you for maybe a quick example of placing everything into a StringBuilder with the new line.
Thanks.
|
|
|
|
|
Did you ever figure this out? I need to edit a line in a text file and I do NOT want to write everything to a new file to do this.
Any help would be appreciated!
Sue
|
|
|
|
|
Hi
I am developing an invoicing application, and I need to know how to
do simple multiplication and addition on a datagrid with values
from different columns ie Qty * Price = SubTotal
Any help would be appreciated
Thanks
chris-s@54.co.za
|
|
|
|
|
If u r having any associated DataSource for that grid like Data Table or Data Set u can set particular column value in particular row...That will automaticalle be updated in the grid.
If u want to update All the Rows ata time u can even use loops like as follows
int i;
for(i=0;i< dt.Rows.Count;i++)
{
dt.Rows[i][2]=Convert.ToInt32(dt.Rows[i][0]) * Convert.ToInt32(dt.Rows[i][1]);
}
Here in ur case the
first column is QTY
Second Column is Price and
third column may be SubTotal
|
|
|
|
|
If u bound a datatable to your grid just create a new column with an expression attached to it e.g.:
dataTable.Columns.Add("SubTotal", typeof(double), "Qty * Price");
|
|
|
|
|
I have several computers to run programs, which are all console program, and do not needed to input any thing when they runs. I don't want to go over around to see whether program is over. Who have saw a tool like that I can input a command and my program can run in a different computer , when it run over the tool can email me a message. Anyway, I can just sit in my seat and control my program in other computer. Because there are too many computers, it's too difficult to use remote connections. Someone can help me? Thanks.
Qi Zhang
|
|
|
|
|
interesting.
first you need to deploy your program to the "other computer". there is not way of automatically running the program. second, you cannot start the program remotely unless you use WMI or something else to get it run.
the easiest way of implementing the server client you are talking about is to use .net remoting. its not the most efficient way of going about this but its very easy.
>I can just sit in my seat and control my program in other computer
Make sure you don't reinvent the wheel. See if there is a solution already.
|
|
|
|
|
Thank you very much. I think that the tools's structure shoubld be c/s. It's clients run in other computers. I can through a server to control my programs and need not known which computer it runs in.
|
|
|
|
|
I have a control C that extends control B that extends control A. In control C's OnXYZEvent method, I occassionaly need to call control A's OnXYZEvent rather than control B's (as control B's does something I may not want it to do) - ie:
OnXYZ()<br />
{<br />
<br />
if (_)<br />
{<br />
base.OnXYZ();<br />
}<br />
else<br />
{<br />
???<br />
}<br />
}
Is this at all possible?
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
|
Thats what I thought, and its so not what I wanted to do
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|