Click here to Skip to main content
14,978,175 members

Comments by charles henington (Top 176 by date)

charles henington 26-Aug-16 0:51am View
   
what do you mean get rid of Form?
charles henington 8-May-14 7:30am View
   
what System.Drawing.Imaging.ImageFormat is the original image in? to save that image as i mentioned above it has to have an encoder for that image ex. Jpg,Bmp,Png, or gif
charles henington 12-Feb-14 12:13pm View
   
yes bill you are absolutely correct i only asked about row as im trying to get column first once i fiqure out how to do this with rows then ill be able to apply such on the columns as well
charles henington 12-Feb-14 12:11pm View
   
Thanks for the link. Checked it out but the issue that im facing is not simply finding a color at a given point or the most commonly used color but rather finding the length that each color continues in first row and then 2nd set and 3rd set so on and so on in first row store that data then move on to the second row and so on and so on. this is the first step once i get this narrowed down then same would have to be done with columns alike
charles henington 10-Feb-14 3:07am View
   
Can you narrow down exactly when the error occurs? is it during the actual crop/resize or when saving the file? the reason I ask is if your saving the file but it's not an bmp, gif, jpg, or png then windows has no actual encoder/decoder for the image.
charles henington 6-Sep-13 6:34am View
   
my vote of 1 also
charles henington 13-Aug-13 5:31am View
   
does your catch block catch an exception if so what is the exception.
charles henington 18-Jun-13 19:33pm View
   
check my solution if it's what your looking for mark the solution as answered. If your looking for a StringReader that reads cyrillic text you can inherit from StringReader class and load the text as Cyrillic using Encoding.UTF8. I would suggest using StringBuilder to first build the string then load into StringReader. Happy Coding
charles henington 9-Jun-13 2:49am View
   
if you solved the question then please share the results as others may be looking for the same help
charles henington 8-Jun-13 23:22pm View
   
try google
charles henington 19-May-13 5:26am View
   
could you post an example of the xml file your reading?
charles henington 14-May-13 4:40am View
   
are you trying to show a preview of the html source or the webpage the way it looks in browser?
charles henington 26-Apr-13 19:29pm View
   
The subtract day was only for the minus one day from the end result not ment to subtract for daylight savings
charles henington 26-Apr-13 13:18pm View
   
im not experienced in asp.net but i believe you would access the htmldocument via javascript as
<script type="text/javascript">
function changeSrc(string newsource){
document.getElementById('src').value = newsource;
}
</script>
charles henington 26-Apr-13 13:08pm View
   
Deleted
disregard the later half of my last comment. Are you using a WebBrowser Control or are you using asp.net?
charles henington 26-Apr-13 13:02pm View
   
posting multiple times wont get your question solved and will actually irritate other users if you would like to word or phrase the question in a different way you can update the original post
from the source that you have provided and the question that you have asked there is not enough to go on to give an adaquate solution we would need you to give a better description of hat you are trying to accomplish perhaps provide a little more detail on the source code in question. Are you experiencing an exception or just can't fiqure out how the code works? What have you tried?
charles henington 26-Apr-13 12:53pm View
   
you should set the iv to 16 and the key to either 16 0r 32

public string Encrypt128(string Data, string Password)
{
byte[] clearBytes = System.Text.Encoding.Unicode.GetBytes(Data);


PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,


new byte[] { 0x00, 0x01, 0x02, 0x1C, 0x1D, 0x1E, 0x03, 0x04, 0x05, 0x0F, 0x20, 0x21, 0xAD, 0xAF, 0xA4 });
MemoryStream ms = new MemoryStream();

Rijndael alg = Rijndael.Create();
alg.Key = pdb.GetBytes(16);

alg.IV = pdb.GetBytes(16);
CryptoStream cs = new CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write);

cs.Write(clearBytes, 0, clearBytes.Length);
cs.Close();
byte[] encryptedData = ms.ToArray();
return Convert.ToBase64String(encryptedData);


}
or you could also use

public string Encrypt256(string Data, string Password)
{
byte[] clearBytes = System.Text.Encoding.Unicode.GetBytes(Data);


PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,


new byte[] { 0x00, 0x01, 0x02, 0x1C, 0x1D, 0x1E, 0x03, 0x04, 0x05, 0x0F, 0x20, 0x21, 0xAD, 0xAF, 0xA4 });
MemoryStream ms = new MemoryStream();

Rijndael alg = Rijndael.Create();
alg.Key = pdb.GetBytes(32);

alg.IV = pdb.GetBytes(16);
CryptoStream cs = new CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write);

cs.Write(clearBytes, 0, clearBytes.Length);
cs.Close();
byte[] encryptedData = ms.ToArray();
return Convert.ToBase64String(encryptedData);


}
charles henington 26-Apr-13 12:51pm View
   
??!?
charles henington 26-Apr-13 12:48pm View
   
Sorry, don't recall that article :)
charles henington 26-Apr-13 10:21am View
   
the iv of rijndael must be set to 16 where the key can be set to 16 or 32, have never had a reason to change the blocksize, I will provide a few encrypt and decrypt methods that will accept a password to protect the data
charles henington 12-Apr-13 5:40am View
   
By adding IDisposable to the driver class this makes all classes that derive from the driver class disposable. Now you wont want to do the same thing for every class that derives from driver as each class will be independant on the dispose call? That being said in the driver class make the public void Dispose(){//code here} to public abstract void Dispose();. this forcesses you to implement the Dispose Method in each class as an override and allows you to use as needed for that class hope this helps
charles henington 10-Apr-13 16:21pm View
   
your bitmap is set as nothing thats why it throws an error on setPixel. when the bitmap is set as nothing then it will throw a not set to the instance of an object because the bitmap has not been set to the instance of a bitmap. if you have a 700 X 500 size image then set your bitmap as Dim myBitmap As New Bitmap(700, 500) and it will now be set to the instance of a bitmap.
charles henington 10-Apr-13 16:16pm View
   
not a problem if this helps please mark the solution as answered :)
charles henington 24-Mar-13 18:30pm View
   
You could use Gmail send to telephoneNumber@smsgateway
charles henington 12-Mar-13 13:26pm View
   
try it on port 80 and alternating EnableSsl i know that when using yahoo EnableSsl must be set to false perhaps thats the case here. also check out http://support.godaddy.com/groups/email/forum/topic/cant-send-email-using-smtpout-secureserver-net/.
theres an interesting fix with the server address perhaps that may be of assistance to you
charles henington 11-Mar-13 6:53am View
   
not sure but i know in most cases the @domainname part must be included.
also ive noticed that you call the smtp.UseDefaultCredentials = false; after you specify the NetworkCredentials try calling the UseDefaultCredentials = false before you change the Credentials when i sent a message with gmail it must be done in this manner or an error will be thrown
charles henington 13-Feb-13 23:47pm View
   
voted incorrectly based on previous solution my apolizies the vote has been updated.
charles henington 13-Feb-13 23:46pm View
   
mistakenly voted a 3 and wont let me change to a 1 so consider this one a gift but the reson for this vote is that way2sms only works in India
charles henington 13-Feb-13 23:44pm View
   
Deleted
Reason for my vote of 1...way2sms only works for India
charles henington 20-Jul-12 17:26pm View
   
And that would be correct my 5 and thanks for the reply
charles henington 17-Jul-12 0:31am View
   
yet another 5 my friend very true on the issue of resources. I prefer to use a simple Panel with the OnPaint event
charles henington 17-Jul-12 0:25am View
   
I have never thought of doing a form in this manner but i can see the many possibilities oop experience is a must and this shows your understanding of this as always my 5
charles henington 17-Jul-12 0:13am View
   
Have a look at this http://www.codeproject.com/Articles/98598/How-I-explained-Design-Patterns-to-my-wife-Part-1
charles henington 12-Jul-12 20:59pm View
   
Reason for my vote of 3
Nice Example but I would suggest having a try catch in there if the server returns a not allowed to access exception
charles henington 13-May-12 4:29am View
   
Thanks VJ :) Great example to you as well
charles henington 13-May-12 4:20am View
   
Very nice VJ.. I haven't looked into regex much but it seems to be a very useful tool that would be worth looking into :)
charles henington 13-May-12 4:19am View
   
Thanks Mika :)
charles henington 12-May-12 22:10pm View
   
Great link on the read text file word by word using linq!!! My 5
charles henington 11-May-12 1:27am View
   
Reason for my vote of 1
see my comment below
charles henington 7-Apr-12 11:26am View
   
Reason for my vote of 1
this is an extremely basic example and there is no point to the HttpPostedFile.
Try creating a class and derive the class from generic List%lt;string%gt; or List%lt;Attachment%gt; and IDisposable(to clean up resources)
charles henington 7-Apr-12 0:08am View
   
my 5
charles henington 9-Jul-11 20:15pm View
   
Deleted
Did you Find the link useful?
charles henington 9-Jul-11 20:14pm View
   
Deleted
Reason for my vote of 1
see my reason above
charles henington 9-Jul-11 20:13pm View
   
Deleted
CreateParams can only be called once but setting the opacity to 0 someone else could easily say Form1 form = new Form1(); form.Opacity = 100; form.ShowDialog(); now form is visible, where they can't make another instance of CreatParams to make Form Visible.
charles henington 9-Jul-11 20:06pm View
   
Deleted
thanks but no thanks got it fixed
charles henington 5-Jul-11 21:24pm View
   
Deleted
Reason for my vote of 4
Great Example but, I would set the Cancel button to DialogResult.Cancel, but i would call the Login Button to DialogResult.Cancel if UserName and Password Didnt Match and to DialogReust.OK if They Did. Just a thought :)
charles henington 5-Jul-11 20:08pm View
   
Deleted
Well if you think so where is the Alternative????
charles henington 30-Jun-11 10:28am View
   
Thanks was playing around with the backcolor to set to a light green but made a mistake got it fixed now thanks
charles henington 28-Jun-11 17:20pm View
   
Deleted
updated my vote to 4 works just great but stil perfer my method as i like to use enum values and switches but good job on the alternate :)
charles henington 28-Jun-11 12:07pm View
   
Deleted
Reason for my vote of 1
It's Javascript
charles henington 28-Jun-11 11:41am View
   
Deleted
Reason for my vote of 1 Yes it very well could be I just personally am a fan of switches and enum's plus it makes the code look cleaner. Also why would you use OpenSubKey if you don't even know if the key Exist? If you are going To do that then you need to Check if the Key Exist First.
bool exists = true;
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\TestApp\1.0"))
{
if (key == null) exists = false;
}
if(exists)
{
// now set the value
}
else
{
// use CreateSubKey
}
Using CreateSubKey will Create if it doesn't exist and if it does exist will set the sub key so it cuts out needing to check if the key exist :) Plus I just checked you method running regedit from command line and yours doesnt change value.
charles henington 28-Jun-11 11:40am View
   
Deleted
Reason for my vote of 1
Yes it very well could be I just personally am a fan of switches and enum's
charles henington 28-Jun-11 11:13am View
   
Deleted
Reason for my vote of 3 Yes it very well could be I just personally am a fan of switches and enum's plus it makes the code look cleaner. Also why would you use OpenSubKey if you don't even know if the key Exist? If you are going To do that then you need to Check if the Key Exist First.

bool exists = true;

using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\TestApp\1.0"))
{
if (key == null)
exists = false;
}
if(exists)
{
// now set the value
}
else
{
// use CreateSubKey
}

Using CreateSubKey will Create if it doesn't exist and if it does exist will set the sub key so it cuts out needing to check if the key exist :) Happy coding
charles henington 28-Jun-11 11:12am View
   
Deleted
Reason for my vote of 3
Yes it very well could be I just personally am a fan of switches and enum's
charles henington 28-Jun-11 11:10am View
   
Deleted
Reason for my vote of 3
Yes it very well could be I just personally am a fan of switches and enum's plus it makes the code look cleaner
charles henington 27-Jun-11 21:41pm View
   
Deleted
Sorry was slow on the reply lol
charles henington 27-Jun-11 21:41pm View
   
Deleted
I have given it thought yes, able to accomplish as of this moment no, I will continue to try and find the answers but since your unable to give me an example would you mind a revote, Thank You :)
charles henington 27-Jun-11 21:32pm View
   
Deleted
I haven't come across anyone yet who can...Can you? If So Please Do Leave An Alternative...If not Please reconsider changing you mind on the vote :)
charles henington 27-Jun-11 18:01pm View
   
Deleted
Reason for my vote of 5
Good one i have used before works well and less confusing for user :)
charles henington 27-Jun-11 18:00pm View
   
Deleted
I Agree with the Griff here much easier and less confusing for the end-user and as well if you will take a look at some of the downloads you install from Microsoft they use the same method(or at least the X box is disabled) which this is a much better way to do for the end user because they know that the button is to be red and takes away much confusion. My 5 4 Griff
charles henington 26-Jun-11 18:28pm View
   
Deleted
updated
charles henington 26-Jun-11 18:27pm View
   
Deleted
updated
charles henington 24-Jun-11 17:35pm View
   
although this was not the correct answer that i was looking for the href part of your solution did point me in the right direction So I gave you a 4. thank you for the help and for the correct way using the HtmlDocument please see my solution below.
charles henington 24-Jun-11 17:18pm View
   
I agree 100% Christian check out my reply on their solution
charles henington 24-Jun-11 15:44pm View
   
Deleted
To use just do this

TabPage MySelectedTab = ActiveTab;
if (MySelectedTab != null)
{
// do what you need with the Selected TabPage Here
}
charles henington 24-Jun-11 2:06am View
   
if it's a Control couldn't you just as easily use Control.FindForm();
charles henington 23-Jun-11 23:38pm View
   
true but actually the correct way is to use ownedForm and owner like this

Form2 newForm = new Form2();
this.AddOwnedForm(newForm);
newForm.Show();

then on the exit call use

this.Owner.Close();

Check out the example Windows-Form-application by SAKryukov
charles henington 23-Jun-11 23:25pm View
   
Reason for my vote of 1... see earlier comment plus my solution above
charles henington 23-Jun-11 23:15pm View
   
Deleted
Look easy way

public partial class Form2 : Form
{
private Form _ParentForm;

public Form2(Form form)
{
InitializeComponent();
this._ParentForm = form;
}

private void button1_Click(object sender, EventArgs e)
{
this._ParentForm.Close();
}
}

Now to use the method Form2 form = new Form2(this);
form.Show();
charles henington 23-Jun-11 23:00pm View
   
What do You Mean "This makes no sense at all. Your parent form won't close while a child is open" Of Course it will you need to reevaluate that statement!!!
charles henington 23-Jun-11 20:33pm View
   
Deleted
Reason for my vote of 1
yes but easier for someone else to change yours
charles henington 23-Jun-11 17:44pm View
   
There is no document.ActiveElement.href in HtmlDocument, Perhaps in Javascript Im not sure. I havent worked with Javascript would you perhaps know how i would go about using javascript to return the value?
charles henington 21-Jun-11 10:45am View
   
I have a question for you as you seem to be quite the expert in asp.net. I program in WinForms and I'm currently designing a webBrowser and have googled a great bit on how to get the link of the Element that currently has focus. Do you have any idea how i might be able to go about doing so?
charles henington 21-Jun-11 10:26am View
   
Brij You get my 5 and Marcus I disagree seeing how a code is structured, written and a visual representation of how a certain outcome was achieved is a great way to learn. All Programmers (Even Yourself) can not say that they have never learned anything from a complete tip/trick or tutorial, which is exactly what you have stated above. When learning programming a visual representation in my opinion is the easiest way to understand and learn from. That being said i think you owe a reconsideration on your vote of 2.
charles henington 20-Jun-11 18:17pm View
   
Image img(string path)
{
if (Image.FromFile(path) != null)
{return Image.FromFile(path)}
return null;
}
charles henington 20-Jun-11 18:15pm View
   
You are welcome, glad i could help:)
charles henington 15-Jun-11 20:27pm View
   
he mentioned already that he was using the correct font and that it shows up but friends cant view it as intended. So in a nuttshell he is using a Font that is installed on his system but not on there system see my post above how to include fonts not installed on their system to get the results wanted :)
charles henington 15-Jun-11 20:16pm View
   
my 5 see my post below on simple way to add font
charles henington 15-Jun-11 20:12pm View
   
button1.BackroungImage = ""; will thow error Error Cannot implicitly convert type 'string' to 'System.Drawing.Image'
charles henington 15-Jun-11 19:59pm View
   
my vote of 5
charles henington 15-Jun-11 17:44pm View
   
or use TextBox5_Enter Event handler then on enter just set the text to String.Empty;
charles henington 31-May-11 3:15am View
   
what have you tried?
charles henington 16-May-11 16:53pm View
   
thats a 5 here commented above on the foreach loop but didn't scroll down to read other post good eye
charles henington 16-May-11 16:50pm View
   
I see also that he set the openfileDialog's Filename to textbox1 and again the filename to textbox2 but in the foreach method he calls openFileDialog's FileNames. I think he expects that each time the filename of the openfiledialog is used that it is to add a new filename as if it were a List<String> or an array
charles henington 15-May-11 10:52am View
   
Deleted
thanks here is a numericTextBox control I belive that i got from MSDN
public class NumericTextBox : TextBox
{
bool allowSpace = false;

// Restricts the entry of characters to digits (including hex), the negative sign,
// the decimal point, and editing keystrokes (backspace).
protected override void OnKeyPress(KeyPressEventArgs e)
{
base.OnKeyPress(e);

NumberFormatInfo numberFormatInfo = System.Globalization.CultureInfo.CurrentCulture.NumberFormat;
string decimalSeparator = numberFormatInfo.NumberDecimalSeparator;
string groupSeparator = numberFormatInfo.NumberGroupSeparator;
string negativeSign = numberFormatInfo.NegativeSign;

string keyInput = e.KeyChar.ToString();

if (Char.IsDigit(e.KeyChar))
{
// Digits are OK
}
else if (keyInput.Equals(decimalSeparator) || keyInput.Equals(groupSeparator) ||
keyInput.Equals(negativeSign))
{
// Decimal separator is OK
}
else if (e.KeyChar == '\b')
{
// Backspace key is OK
}
// else if ((ModifierKeys & (Keys.Control | Keys.Alt)) != 0)
// {
// // Let the edit control handle control and alt key combinations
// }
else if (this.allowSpace && e.KeyChar == ' ')
{

}
else
{
// Consume this invalid key and beep
e.Handled = true;
// MessageBeep();
}
}

public int IntValue
{
get
{
return Int32.Parse(this.Text);
}
}

public decimal DecimalValue
{
get
{
return Decimal.Parse(this.Text);
}
}

public bool AllowSpace
{
set
{
this.allowSpace = value;
}

get
{
return this.allowSpace;
}
}
}
charles henington 15-May-11 10:47am View
   
Deleted
you use OnKeyPress write a method then post an alternative, you google what you want dont pass your ignorance off on me
charles henington 15-May-11 10:29am View
   
Deleted
check reply
charles henington 15-May-11 10:07am View
   
Deleted
check out my reply
charles henington 15-May-11 10:07am View
   
Deleted
Your not very bright are you?
charles henington 15-May-11 10:04am View
   
Deleted
what is a new? ok create one address but what about the other? You still need both
charles henington 14-May-11 12:27pm View
   
Deleted
You are correct Chris, sorry was in the middle of two different projects when posted this tip but still no excuse., the string.Format() method would easily suffice for formatting the rgb to hex. EdMan apoligies for the lack of explanation on the tip/trick, thought the title gave it away, sometimes we forget to remember that the tip/tricks that we supply are also read by newbies to the language and should be adaquately explained. String.Format is a very important tool you will want to read up on this topic. A simple example would be MessageBox.Show(String.Format("Your Name is {0}!!!", textBox1.Text)); if the text in textBox1 is EdMan the output would be.... Your Name Is EdMan!!!
charles henington 14-May-11 11:50am View
   
Deleted
Reason for my vote of 1
The point was a way using Enum.Parse not a simple DockStyle thanks for the effort though this might be a good solution if not using Enum.Parse thanks for the post
charles henington 14-May-11 11:35am View
   
Not sure if I understand your question. but if you want to use a call to change objects in form1 from form2 use the method above but if you want to change an object in form2 from another form put internal static Form2 FormHook in form2 and call form2 from other forms
charles henington 10-May-11 6:55am View
   
why Public? why not internal? if is not be used from another application but from within the same application is better to use internal as to not make the form's hook method visible to outside source's
charles henington 10-May-11 6:39am View
   
A 4 from me although the poster wanted to send information to a previous form which the link explains sending to a new Form but the basics lie here in this link. Great solution but please check out my solution.
charles henington 9-May-11 17:54pm View
   
is the form the current form or a differnt form? will the panel be include in the panel if is the current form?
charles henington 9-May-11 3:23am View
   
Thanks Mahendra the second solution was exactly what i needed instead of
Regex.IsMatch(password, @"/.[!,@,#,$,%,^,&,*,?,_,~,-,£,(,)]/", RegexOptions.ECMAScript)
had to use
Regex.IsMatch(password, "^[!,@,#,$,%,^,&,*,?,_,~,-,£,(,)]+$", RegexOptions.ECMAScript)
charles henington 9-May-11 0:52am View
   
no im not trying to Restrict characters. I'm trying to determine if the password contains special characters and if so then update the password strength meter if characters exist
charles henington 5-May-11 20:15pm View
   
Deleted
please see 12 Apr '11 reply
charles henington 5-May-11 17:05pm View
   
Deleted
report wrong? it returns the first 3 letters of the drive c:\, f:\, d:\, etc. etc. Not sure of the file system virtualization will have to look into that but as for privileges Environment.SystemDirectory.Remove(3) simply returns the top directory of the local user if i'm missing something please eloborate??
charles henington 2-May-11 20:36pm View
   
no problem hope it helps :)
charles henington 2-May-11 8:38am View
   
do MessageBox.Show(filename) inspect the file name to ensure that it is correct. You may be missing an \ between the last directory and filename.
charles henington 29-Apr-11 19:49pm View
   
Deleted
Reason for my vote of 3
see my previous comment
charles henington 29-Apr-11 19:48pm View
   
Deleted
Works just fine brain i've even checked myself although one line of code is incorrect
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( int out Description, int ReservedValue ) ;
Should be
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState( out int Description, int ReservedValue ) ;
charles henington 29-Apr-11 19:33pm View
   
:-) Nice lol
charles henington 29-Apr-11 19:30pm View
   
Was that a question?
charles henington 29-Apr-11 18:23pm View
   
Read SA's Post about converting Image To Grayscale and didn't pay attention to the post below my apoligies but here is a way to convert images to grayscale if needed. and Sa will be recieving my 5
charles henington 29-Apr-11 15:18pm View
   
? what ? Please rephrase your question. grayscale maybe?
charles henington 29-Apr-11 2:14am View
   
or

Form2 f2 = new Form2();
if (f2.ShowDialog()==DialogResult.Cancel)
return;
DoSomethingHere();
charles henington 28-Apr-11 20:11pm View
   
Just thought you might want to know the xml schema that i use is
<RssItem><Rss Url="someUrl1"/><Rss Url="someUrl2"/></RssItem>
charles henington 28-Apr-11 20:05pm View
   
mouse position can be found using MousePosition.X MousePosition.Y this will give you the x,y cordinates of the mouse
charles henington 27-Apr-11 19:41pm View
   
Use Google he is your friend. I will not do your assignment for you it is not fair to your classmates who are doing their work nor is it fair to you.
charles henington 27-Apr-11 19:36pm View
   
if you want to use apply button you dont need a check changed and just place in the button click event

SwapMouseButton(Convert.ToInt32(BtnChkBoxBC.Checked));
charles henington 27-Apr-11 19:31pm View
   
you are using the checkckanged property so it will be applied when the check box changes
charles henington 27-Apr-11 19:24pm View
   
if (!BtnChkBoxBC.Checked)
{
SwapMouseButton(1);
}
else
{
SwapMouseButton(0);
}
charles henington 27-Apr-11 19:22pm View
   
apply only one that is calling both and setting back to normal
charles henington 27-Apr-11 8:26am View
   
show the code in the button click event
charles henington 26-Apr-11 21:10pm View
   
if you like and it works for you vote a 5 and accept answer
charles henington 25-Apr-11 17:24pm View
   
Deleted
No the boolean can be either user or the person using code snippet, however the person using the snippet decides. you can hard code the boolean value to always return true or always false, return true if certain conditions are met such as the commandline arguments meet a certain criteria, or if say settings value or xml value are set to either true or false then it will allow or not allow second instance based on the supplied criteria. they are different in the sense that it will allow the value to be different based on the boolean value but they are the same as in the sense that they will both prevent a new instance from starting making it a single instance the boolean must be set to true.
charles henington 23-Apr-11 17:00pm View
   
my 5, First link hit the spot although I had to alter the code a bit. Had to drop column, and change the XmlReadMode to InferSchema
charles henington 22-Apr-11 21:12pm View
   
I use this code to get xml

<pre lang="cs">private string MakeXml()
{
string xml = string.Empty;
List<String> WebUrls = new List<String>();
string ExtractedSourceCode = null;
using (WebClient client = new WebClient())
{
ExtractedSourceCode = ASCIIEncoding.ASCII.GetString(client.DownloadData("http://www.feedzilla.com/rss.asp"));
}
string[] SeperatedLines = new string[] { };
SeperatedLines = ExtractedSourceCode.Split(SeperatedLines, StringSplitOptions.RemoveEmptyEntries);
foreach (string lines in SeperatedLines)
{
if (lines.StartsWith("href='rss"))
{
string ExtractedUrl = lines.Replace("><img", "");

WebUrls.Add(ExtractedUrl.Replace("href=", "http://www.feedzilla.com/").Replace("'", ""));
}
}
xml = "<RssItem>";
foreach (string RssUrl in WebUrls)
{
xml += "<Rss Url=\"" + RssUrl + "\"/>";
}
xml += "</RssItem>";

return xml;
}</pre>

Now I have the Urls in xml format a little more than 1600 links and i want to display them in one Column each lnk in its own row. that way on Row select I can make my Custom built TabPage Load which will load the browser in my tabpage to the text within the selected Row
charles henington 22-Apr-11 12:09pm View
   
Deleted
A new instance of form will not run if value is set to true but will if value is set to false. this gives whoever uses the snippet to hardcode the true false value or if certain conditions are meet to run a new instance but it does not have a chance if the value is true
charles henington 22-Apr-11 12:08pm View
   
Deleted
Reason for my vote of 4
nice not a fan of vb but a 4 none the less
charles henington 22-Apr-11 12:07pm View
   
Deleted
Reason for my vote of 5
nice alternative
charles henington 22-Apr-11 11:17am View
   
Deleted
Reason for my vote of 5
good example my 5
charles henington 22-Apr-11 10:57am View
   
Deleted
if your going to vote atleast leave a comment explaining the reason for you vote. It works and much smaller code than most
charles henington 22-Apr-11 10:54am View
   
Deleted
not great wit regex. if you could possibly post an example to study would be glad to learn and update
charles henington 22-Apr-11 10:43am View
   
Deleted
too monstrous? :Laugh it's a array, dumb ass it was placed as such for demonstration read from text file, resource, xml file, ini file, database...Would you really expect someone to keep that array in code? Honestly!! use your brains if you have any
charles henington 22-Apr-11 10:41am View
   
Deleted
if you want to allow characters that are in the UnappovedChar then just remove that char from string and continue as normal
charles henington 19-Apr-11 19:43pm View
   
thank you Nishant
charles henington 19-Apr-11 19:42pm View
   
No prob SA I have followed your stuff for some time and have not yet seen you post anything under 5+
charles henington 19-Apr-11 18:59pm View
   
Who would vote that a 1 does it not answer his question and without exposing the label to the parent form
charles henington 19-Apr-11 18:56pm View
   
my 5
charles henington 19-Apr-11 17:38pm View
   
Deleted
It really doesn't make a differnce the Control.CheckForIllegalCrossThreadCalls is For debug purposes
charles henington 19-Apr-11 17:36pm View
   
Deleted
it's the exact same code just reworded To include as class file same result's no difference
charles henington 19-Apr-11 17:30pm View
   
Deleted
yea same problem i ran into thats why i posted above. What some Op's dont seem to realize is because it works on there computer. Unless there going to send each client a computer running the same os as they are RAVI that would become quite expensive try to make your code more robust. look outside your box and try to make work for all.
charles henington 19-Apr-11 10:44am View
   
Deleted
thanks for the feed back. I took a look at the link. It basically use the bluetooth support from a mobile to interact with the bluetooth to establish connection with other devices and so forth. Perhaps my Question was not clearly stated, Apoligies please allow me to elaborate. I am using Serial Ports but I use bluetooth from my mobile to create a connection with the computer. Once a connection is made I assign a Com Port3 to my mobile to allow my mobile to ask as the com port. In this manner it would be free to send sms messages. I have no trouble on this part as when i attempt to send the message my mobile ask for permission to interact with Chico-PC (my computer). When I hit OK then the app opens the com port to send the Message. The App shows no sign of the message not being send and I also have it set to show me errors from the com port as well as breakpoints inserted to catch any errors but the message is never delivered. I have searched Google and CP and have found a great deal of tutorials and documentation but still no luck. Again i appreciate the help and will keep you informed on any progress. If you see any documentation that you may feel could be beneficial please make we aware of it and thanks again.
charles henington 18-Apr-11 22:06pm View
   
Did You try to add to a DataSet then insert the DataSet into DataTable?
charles henington 18-Apr-11 18:21pm View
   
what is the action that you are trying to do? maybe post your code so we can have a visual understanding of whats going on plus be a ittle more detailed you will get much better feedback
charles henington 18-Apr-11 18:17pm View
   
my 5
charles henington 18-Apr-11 18:17pm View
   
thanks Kim :) and yes you are very correct about the Administrator Rights. I see this so many times from people who want to use from their office where they have limited rights, Plus you can run into problems latter down the line when you get into setting with registry
charles henington 18-Apr-11 11:08am View
   
Deleted
Thanks hope it helps
charles henington 14-Apr-11 17:00pm View
   
Deleted
Sorry, I've gotten to the point where the port opens..No errors are thrown..try to write AT command using a code that I found here on CP but never recieve text message. By the way my bluetooth from phone is connected to computer under Comport 3. thought maybe that was the reason, So I sent to my wife's phone but still no luck... Any suggestions?
charles henington 14-Apr-11 10:00am View
   
Deleted
Reason for my vote of 1
reason stated above
charles henington 14-Apr-11 8:46am View
   
maybe he want's to apply his own background color?
charles henington 14-Apr-11 8:37am View
   
got 5 from me. Can't get any more straight forward than that
charles henington 13-Apr-11 9:25am View
   
Deleted
Reason for my vote of 1
reason for my vote of 1. I don't see anywhere that it prevents a new instance from starting.
charles henington 12-Apr-11 22:06pm View
   
Deleted
why would you base the opacity on the timer1.Interval? thats to control how slow or fast the fade effect is to be.....Without having to recode every time. Plus Your code doesnt even Run Properly because it doesnt even fade in or out because it is invisible on Load. You might want to take a look at the code and work out the bugs.
charles henington 12-Apr-11 22:03pm View
   
Deleted
john you are correct it's easier to add image for example so that users can easily see how it's done, First of all Secret_Garden a base64 image will show just as well and a base64 can be an embedded resource as well. All you have to do is put the Base64String into a text file and read as a string using the method above., Indivara what do you mean forgotten to encode the < and >?
charles henington 12-Apr-11 12:34pm View
   
Deleted
My Post the original tip/trick does use Mutex and where does the run application call come in?
charles henington 12-Apr-11 4:04am View
   
Deleted
If you like and it works for you please rate me a 5
charles henington 11-Apr-11 23:32pm View
   
no problem glad i could help
charles henington 8-Apr-11 9:14am View
   
Reason For My vote of 1
Google couldnt even help that one :)
charles henington 8-Apr-11 0:22am View
   
Deleted
First It Does Work and Two I Think your missing Your If Statement
here is a better look at the code

bool bFailed = false;
bool condition1_fails, condition2_fails, condition3_fails;
// this is basically what the code is saying
/* if (!bFailed)
condition1_fails = condition2_fails = condition3_fails = false;
else
condition1_fails = condition2_fails = condition3_fails = true;*/

// so here you have the outcome with no errors when setting bFails to represent the true/false statements from above. With your code try to add a true false value you get the error The left-hand side of an assignment must be a variable, property or indexer.

// so try using this. Go ahead and give it a try... Change your bFailed value between true and false to test.
bool bFailed = false;
condition1_fails = condition2_fails = condition3_fails = bFailed;
if (bFailed) DoFailedCleanup();
else {
PerformActionOnAllSuccess();
DoNormalCleanup();
}
charles henington 6-Apr-11 20:32pm View
   
Deleted
how about this
bool bFailed = false;
if (!bFailed) bFailed = condition1_fails = condition2_fails = condition3_fails;

if (bFailed) DoFailedCleanup();
else {
PerformActionOnAllSuccess();
DoNormalCleanup();
}
charles henington 6-Apr-11 10:42am View
   
Deleted
thanks
charles henington 6-Apr-11 9:55am View
   
Deleted
Sending mail with attachments

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
<pre lang="cs">
public class MailClass : List<string>
{
public void CreateMailAddresses(string sender, string reciever, out MailAddress mailfrom, out MailAddress mailto)
{
MailAddress Mailfrom = new MailAddress(sender);
MailAddress Mailto = new MailAddress(reciever);
mailfrom = Mailfrom;
mailto = Mailto;
}

public MailMessage MailMessage(MailAddress mailfrom, MailAddress mailto, string subject, string body)
{
MailMessage newmsg = new MailMessage(mailfrom, mailto);

newmsg.Subject = subject;
newmsg.Body = body;
newmsg.IsBodyHtml = true;
return newmsg;
}

public SmtpClient SmtpClient(string sender, string password, string host, bool SslEnabled, int port)
{
SmtpClient smtp = new SmtpClient(host, port);
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential(sender, password);
smtp.EnableSsl = SslEnabled;
return smtp;
}
}
MailClass Mail = new MailClass();
private void button1_Click(object sender, EventArgs e)
{

MailAddress mailfrom;
MailAddress mailto;
Mail.CreateMailAddresses("sender@gmail.com", "reciever@ymail.com", out mailfrom, out mailto);
MailMessage newmsg = Mail.MailMessage(mailfrom, mailto, "Subject of Email", "Body(message) of email");
Byte google;
for (google = 0; google < Mail.Count; google++)
{
newmsg.Attachments.Add(new Attachment(Mail[google]));
}
SmtpClient smtp = Mail.SmtpClient("sender@gmail.com", "password", "smtp.gmail.com", true, 587);
smtp.Send(newmsg);
}

private void button2_Click(object sender, EventArgs e)
{
// add attachments
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.Cancel)
return;
Mail.Add(ofd.FileName);
}
}</pre>
charles henington 5-Apr-11 5:11am View
   
Deleted
In a way of speaking anything that is done differently(even slightly), regardless of how effortless the change may seem is considered an alternative. I say this because Alternative only means a different way to do something but I can also see where you are coming from Sandeep and i also see no major improvement in the code but what i do see is less code which is also a plus. in some cases Less bulky code and less loops can result in faster and less painful application lags and response times.
charles henington 5-Apr-11 4:58am View
   
Deleted
Dont you mean System.Windows.Forms for OpenFileDialog?
charles henington 26-Mar-11 16:16pm View
   
to remove the close, minimize, and maximize buttons set the formboderstyle to none. Only problem with this is the form is not moveable so you will need to add methods to make the form moveable(if you want it to be moveable). and as for the form staying on top of all other forms event the task manager. you can do it blunt force and add a timer. in the tick event if(!this.TopMost){this.TopMost=true;} that will force the form over all open windows even taskmanager.
charles henington 24-Mar-11 21:42pm View
   
My Apologies i misread you want the actual scroll bar like in html scrollbar colorization i simply gave you a method to change the color of the drop down button thats to be clicked if you like your more than welcome to try that out and see how you like it and maybe come in handy in future again sorry about the misunderstanding
charles henington 21-Mar-11 20:19pm View
   
once again Griff another 5 Had same problem loading flash swf file in embeded browser in winform on wife's win7 no flash installed was indeed the culprit
charles henington 21-Mar-11 20:14pm View
   
you get my 5 Griff very true when i first started programming I used the Application.DoEvents() when trying to do a conversion of a byte[] to a encryption method that required a string input it blew right by the error but the output was not pretty :(
charles henington 21-Mar-11 2:46am View
   
Deleted
You could also use Xml file to accomplish this
charles henington 19-Mar-11 13:04pm View
   
can you please explain your post in more detail your english is hard to follow
charles henington 19-Mar-11 12:37pm View
   
Deleted
True that is another way to do the same thing. The reason that I built it the way that i have is so the code will be in a class file so that it can be included in a framework
charles henington 17-Mar-11 19:49pm View
   
Deleted
How is that not clear? He wants to raise a click event on a button on completion of a timer tick!
charles henington 17-Mar-11 19:46pm View
   
Deleted
too bad there is no 0
charles henington 17-Mar-11 19:37pm View
   
My vote of 5.
charles henington 17-Mar-11 19:37pm View
   
yet another 5
charles henington 17-Mar-11 18:44pm View
   
My vote of 5 that is the easiest way to do it on page load with the least amount of code.
charles henington 14-Mar-11 17:38pm View
   
Deleted
If you are not using yahoo plus you will need to set the enableSsl to false. I have built a similar app in the past if i remember correctly I had trouble with port 465 and resorted to port 587
you can download my tutorial at
http://www.codeproject.com/KB/IP/GmailSmtp.aspx
charles henington 14-Mar-11 14:40pm View
   
You would have to use Form1.Hide(); using Form1.Close if is the MainForm will Close the Application imediately after login
charles henington 1-Jun-10 9:34am View
   
Reason for my vote of 1
add positive to post everyone was beginer at some point think back to your first app