|
we meet again!
did you ever try with ProcessStartInfo.CreateNoWindow=true?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
hello mr. yeah i tried all combinations of that process.startinfo but wasnt successful and i was speaking to one guy that also had this problem and he didnt find solution cause its probably some problem with cygwin applications. so im trying this way. do you know how i could copy it from console?
|
|
|
|
|
dwrst wrote: do you know how i could copy it from console?
No. The only thing I ever did programmatically to a Console is set font colors.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi,
I have one doubt,i have developed one software and now iam going to sell it.before selling that package i want to give a trial version to the customer (for 2 weeks) and after that period that software should expire.how can i do it.
Please any one help me regarding in this matter by giving a piece of code or by giving the hint how to solve this problem
Thanks to All
Thanks
modified on Saturday, April 19, 2008 3:34 AM
|
|
|
|
|
You have to come up with a method to do this. If there was one method that everyone used, we'd all know how to defeat it, too. And, of course, anyone can decompile your app, remove your code and recompile it, anyhow.
One thing I will tell you is, don't rely on the date the app was first installed, the file system seems to mess with that, I've had trouble trying to use it in the past.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
dont forget to use obsfucator (from v studio tools menu ) to protect code from disassembling
f(yf) = yf
|
|
|
|
|
|
pyde wrote: default.aspx
So, you meant to ask in the ASP.NET forum then ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Good Day,
When I want to read a file as byte[] in the past, I always use this code:
byte[] Bytes = File.ReadAllBytes(FilePath);
The problem with the above code is it consumes too much memory (I think ) and I can't inform the user of the progress of the file reading.
Is there a better way of reading binary files in such a way that I can get the progress of the reading?
Thanks!
|
|
|
|
|
Ian Uy wrote: The problem with the above code is it consumes too much memory
Only if your file is huge
Ian Uy wrote: I can't inform the user of the progress of the file reading.
True
Ian Uy wrote: such a way that I can get the progress of the reading?
Do it the old way, open the file, create a byte array and read a section at a time, but you'll need to do it on a thread or use Application.DoEvents for your UI to update during the process.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for the reply Mr. Graus.
Christian Graus wrote: Only if your file is huge
I usually read 500mb to 1gb of data.
Christian Graus wrote: Do it the old way, open the file, create a byte array and read a section at a time, but you'll need to do it on a thread or use Application.DoEvents for your UI to update during the process.
Yes, I'll be using a Background Worker for this.
But can please point me to an article on how do it the "old way" using buffers, loops and stuff.
Thank you.
|
|
|
|
|
Ian Uy wrote: I usually read 500mb to 1gb of data.
Well, I hope your users have 2+ gig of RAM and a lot of time then....
Ian Uy wrote: But can please point me to an article on how do it the "old way" using buffers, loops and stuff.
First google hit looks like a good one[^]
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks.
Using the given method on the bottom of the page, I can successfully read a file. But somehow, reading a file that is too large (350mb) gives me an Out of Memory exception.
Is this a problem with the code?
public static byte[] ReadFully (Stream stream, int initialLength)<br />
{<br />
if (initialLength < 1)<br />
{<br />
initialLength = 32768;<br />
}<br />
<br />
byte[] buffer = new byte[initialLength];<br />
int read=0;<br />
<br />
int chunk;<br />
while ( (chunk = stream.Read(buffer, read, buffer.Length-read)) > 0)<br />
{<br />
read += chunk;<br />
<br />
if (read == buffer.Length)<br />
{<br />
int nextByte = stream.ReadByte();<br />
<br />
if (nextByte==-1)<br />
{<br />
return buffer;<br />
}<br />
<br />
byte[] newBuffer = new byte[buffer.Length*2];<br />
Array.Copy(buffer, newBuffer, buffer.Length);<br />
newBuffer[read]=(byte)nextByte;<br />
buffer = newBuffer;<br />
read++;<br />
}<br />
}<br />
byte[] ret = new byte[read];<br />
Array.Copy(buffer, ret, read);<br />
return ret;<br />
}
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Hi,
One of our windows application developed in C#.Net (Visual studio 2005) requires the functionality of
converting .pdf or .doc files to .html file format.
(without lossing the original format in the .pdf or .doc file). We have tried few third party tools, but none of these can keep the same format of the source files. Can anybody help me?Also please suggest few .dotnet supported tools for this conversion.
Thanks in advance
|
|
|
|
|
Atalasoft has a good PDF library, not sure if it does HTML conversion. That would be tough, I would think.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Im currently developing a hybrid code generator / object mapper tool.
The idea is to make a mix of codesmith/mygeneration and our own ObjectMapper.
The project will be published as opensource on codeplex once I've finished a few more features.
What makes Caramel a bit different is that you can plug in your own node types in the meta data tree.
and thus make it possible to generate code for pretty much anything.
Eg. plug in "WebPage" which might be able to contain "EditNodes" and "ListNodes" etc , so that you could generate entire apps.
A few alpha screenshots can be found here:
http://rogeralsing.com/2008/04/14/caramel-screenshots/[^]
Once the infrastructure is done I will start on support for NHibernate and NPersist mapping / entity generation.
So if anyone is interested in joining just let me know
|
|
|
|
|
Hi guys
My issue arises when writing to the MS SQL database if the client machine's regional settings(date format) is different from the regional settings on the SQL server machine. I write the datetime variable to the db as datetimevar.Tostring(), the problem with this is that C# converts the datetimevar to a string in the date format of the local machine.
I thought of writing a method to construct my date string manually in the ISO format of SQL which is YYYYMMDD(no seperators), but i am unsure if the client app will query the dates correctly. If anybody has any suggestions on how to go about solving this it will be greatly appreciated.
|
|
|
|
|
Your core problem is that you're doing things badly. Don't store dates as strings, it limits what you can do with them, and causes these sort of problems. If you must write it that way for now ( even tho I hope you'd learn never to do it again ), you can write code that forces a format string, something like datetime.ToString("MM-DD-YYYY"), I believe.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hey Christian
lapdog is my colleague, he just stepped out...
its not that we need to store the dateTime as text, but rather that when we send it to a sqlStoredProcedure well do something like this..
cmd.commandtext = "sp_someStoredProcedure " + myDateTime.ToString();
is there a better way of sending sql this dateTime?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: is there a better way of sending sql this dateTime?
Very much so
cmd.CommandType = CommandType.StroredProcedure<br />
cmd.CommandText = "sp_someStoredprocedure";<br />
cmd.Parameters.Add(new SqlParameter("@myDate",SqlDbType.Date));<br />
cmd.Parameters["@myDate"].Value = myDateInstance;
(typed quickly, errors may be present, you should get the idea)
|
|
|
|
|
Hey J4amieC,
thanx alot, that seems to be working!
now id like to run a different scenario by you also about dates and times. in my communication application i get data from an external device, a fingerprint scanner to be exact. now it send me the dateTime in a string and there is nothing i can do about that.
so currently when i add it to the dataBase i do this...
<sqlcommand insertcommand="new" sqlcommand(="sp_InsertIntoAccessPunches" ,="" newsqlconn);<br="" mode="hold" />insertCommand.CommandType = CommandType.StoredProcedure;
insertCommand.Parameters.Add("@dateTime", SqlDbType.DateTime);
insertCommand.Parameters["@dateTime"].Value = DateTime.Parse(dateTime);
insertCommand.Parameters.AddWithValue("@empNo", empNo);
insertCommand.Parameters.AddWithValue("@TerminalID", terminalID);
cmd.ExecuteNonQuery();
what do you think?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
|
I don't see any code that would make you feel that the data source should be edited ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
sorry i didnt get you?
A pencil icon appears in datagrid whenever we edit any of its column.This icon is not appearing after insertion of combobox or any other control.Hence a new row is not getting added to datagrid.I need to perform insertion of data in database using datagrid.
|
|
|
|
|
sarilee wrote: A pencil icon appears in datagrid whenever we edit any of its column.
This occurs in a gridview, if you happen to configure it to use such an icon. I didn't know a datagrid supported that behaviour at all.
sarilee wrote: I need to perform insertion of data in database using datagrid.
OK - then you need to render the controls that will contain the data and write database code to store it. Sounds like you're half way there.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|