Click here to Skip to main content
15,920,468 members
Home / Discussions / C#
   

C#

 
AnswerRe: Float Data Type Pin
Dan Neely8-Oct-07 4:52
Dan Neely8-Oct-07 4:52 
GeneralRe: Float Data Type Pin
Imran Adam8-Oct-07 4:58
Imran Adam8-Oct-07 4:58 
GeneralRe: Float Data Type Pin
Anthony Mushrow8-Oct-07 5:06
professionalAnthony Mushrow8-Oct-07 5:06 
AnswerRe: Float Data Type Pin
Pete O'Hanlon8-Oct-07 5:10
mvePete O'Hanlon8-Oct-07 5:10 
Questioncheck if record exist in a database C# sql 2005 Pin
Gazide8-Oct-07 4:02
Gazide8-Oct-07 4:02 
AnswerRe: check if record exist in a database C# sql 2005 Pin
Andrei Ungureanu8-Oct-07 4:18
Andrei Ungureanu8-Oct-07 4:18 
GeneralRe: check if record exist in a database C# sql 2005 Pin
ffowler8-Oct-07 5:49
ffowler8-Oct-07 5:49 
QuestionOnline Verification Pin
Nokoff8-Oct-07 4:00
Nokoff8-Oct-07 4:00 
Hi there, I am currently in negotiations with a customer that wishes to purchase an application that I have developed for him in C#. My dilemma is that although I trust him I wish to be able to give him a working copy of the application knowing that he will not just be able to 'steal' it. Seeing as the application needs to be online to function in any case I thought that maybe I could incorporate a request into the application to verify whether or not it should run so that I can disable it if something smells funny rendering the application useless.

I have attempted to use a HttpWebRequest request to try and retrieve the string of a file on my website and authenticate it that way but it seems that it caches somewhere or something but it takes a very long time for it to take effect. Here is my current Verification method:

private bool allowedToRun()<br />
        {<br />
            // used to build entire input<br />
            StringBuilder sb = new StringBuilder();<br />
<br />
            // used on each read operation<br />
            byte[] buf = new byte[8192];<br />
<br />
            // prepare the web page we will be asking for<br />
            HttpWebRequest request = (HttpWebRequest)<br />
                WebRequest.Create("urlOfMyWebPage.html");<br />
<br />
            // execute the request<br />
            HttpWebResponse response = (HttpWebResponse)<br />
                request.GetResponse();<br />
<br />
            // we will read data via the response stream<br />
            Stream resStream = response.GetResponseStream();<br />
<br />
            string tempString = null;<br />
            int count = 0;<br />
<br />
            do<br />
            {<br />
                // fill the buffer with data<br />
                count = resStream.Read(buf, 0, buf.Length);<br />
<br />
                // make sure we read some data<br />
                if (count != 0)<br />
                {<br />
                    // translate from bytes to ASCII text<br />
                    tempString = Encoding.ASCII.GetString(buf, 0, count);<br />
<br />
                    // continue building the string<br />
                    sb.Append(tempString);<br />
                }<br />
            }<br />
            while (count > 0); // any more data to read?<br />
<br />
            // print out page source<br />
            MessageBox.Show("Allowed to run: " + sb.ToString());<br />
            return Convert.ToBoolean(sb.ToString());<br />
<br />
        }


Ideas? Smile | :)
AnswerRe: Online Verification Pin
il_masacratore8-Oct-07 4:16
il_masacratore8-Oct-07 4:16 
GeneralRe: Online Verification Pin
Nokoff8-Oct-07 4:34
Nokoff8-Oct-07 4:34 
GeneralRe: Online Verification Pin
Andrei Ungureanu8-Oct-07 4:42
Andrei Ungureanu8-Oct-07 4:42 
GeneralRe: Online Verification Pin
Nokoff8-Oct-07 4:54
Nokoff8-Oct-07 4:54 
GeneralRe: Online Verification Pin
Andrei Ungureanu8-Oct-07 5:02
Andrei Ungureanu8-Oct-07 5:02 
QuestionDataGridView Selections Pin
ffowler8-Oct-07 3:59
ffowler8-Oct-07 3:59 
AnswerRe: DataGridView Selections Pin
Anthony Mushrow8-Oct-07 4:05
professionalAnthony Mushrow8-Oct-07 4:05 
AnswerRe: DataGridView Selections Pin
Andrei Ungureanu8-Oct-07 4:07
Andrei Ungureanu8-Oct-07 4:07 
GeneralRe: DataGridView Selections Pin
ffowler8-Oct-07 4:15
ffowler8-Oct-07 4:15 
GeneralRe: DataGridView Selections Pin
Andrei Ungureanu8-Oct-07 4:22
Andrei Ungureanu8-Oct-07 4:22 
GeneralRe: DataGridView Selections Pin
ffowler8-Oct-07 5:39
ffowler8-Oct-07 5:39 
QuestionReflection Pin
karoitay8-Oct-07 3:49
karoitay8-Oct-07 3:49 
AnswerRe: Reflection Pin
Judah Gabriel Himango8-Oct-07 4:31
sponsorJudah Gabriel Himango8-Oct-07 4:31 
GeneralThanks Pin
karoitay8-Oct-07 5:29
karoitay8-Oct-07 5:29 
AnswerRe: Reflection Pin
Pete O'Hanlon8-Oct-07 4:32
mvePete O'Hanlon8-Oct-07 4:32 
GeneralRe: Reflection Pin
karoitay8-Oct-07 5:27
karoitay8-Oct-07 5:27 
QuestionDrag and Drop Text Pin
Jinwah508-Oct-07 3:20
Jinwah508-Oct-07 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.