Skip to main content

Posts

Showing posts from April, 2013

Beginners Guide to File Handling in C#, .net

Make a new project in Visual Studio (Console App) Add a new .cs file named as MySetting.cs, in that file copy paste the following code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 using System ; using System.Collections.Generic ; using System.Linq ; using System.Text ;...

HTML and JavaScript Validated form (Simple and Easy)

Hi, In the following web form we have used a simple HTML table and Inline CSS styling, the validation is done via java-script, its vulnerable to threats coz anyone can copy your form from browser and send some idiotic data in it, but good for beginners, all we need is captcha in it to make it more effective. The submit button do nothing, it doesn't have any db call attached with it, so don't worry you can add as much dummy data in it to check the validations. I have taken almost all the required validation and you can take the native code by saving the web page, open it in notepad, search for 'A simple WEB form'. Enjoy...

Asynchronous Threading, First Code

Synchronous threading will execute each thread/command in the order they have been created/started Suppose there are 4 threads A, B, C, D Application Starts at 10:00:00 time: 10:00:00: -> Start thread A (will run for 5 seconds) time: 10:00:05: -> Start thread B (will run for 10 seconds) time: 10:00:15: -> Start Thread B1 (will run for 5 seconds) time: 10:00:20: -> Start thread C (will run for 15 seconds) end application: total run time will be 35 seconds Asynchronous threading will run the threads at the same time/ parallel processing, or we can say it will take the thread that is available at the earliest. Application Starts at 10:00:00 time: 10:00:00: -> Start thread A (will run for 5 seconds) / Start thread B (will run for 10 seconds) / Start thread C (will run for 15 seconds) time: 10:00:10: -> Start Thread B1 (will run for 5 seconds) end application: total run-time will be 15 seconds (because the longest run-time is thread C) So Async Threadi...