- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 4
- Posts with Upvotes
- 3
- Upvoting Members
- 4
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
31 Posted Topics
Hi, what about a derived class like this one (it's very basic, but it might be what you are searching for): [code] public class MyStream : StreamReader { private uint _pos; public MyStream(string path, System.Text.Encoding enc) : base(path, enc) { } public override string ReadLine() { char current; int i; …
Console => Environment.Exit(0) Forms => Form.Close()
ever heard something about googling ? :evil: [URL=http://www.codeguru.com/Csharp/Csharp/cs_graphics/sound/article.php/c6143/]http://www.codeguru.com/Csharp/Csharp/cs_graphics/sound/article.php/c6143/[/URL]
[code] StreamReader sr = new StreamReader("yourFileNameGoesHere", System.Text.Encoding.Default); string s = null; while ((s = sr.ReadLine()) != null) { if (s.IndexOf("fn:") != -1) { // ok, you found it // now you can do like // textBox1.text = s; break; } } sr.Close(); [/code]
[code] using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Text.RegularExpressions; namespace WindowsApplication1 { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Button button1; /// <summary> /// Required designer variable. /// </summary> …
[url]http://www.amazon.com/gp/product/0735616485/103-7891102-8341404?v=glance&n=283155&v=glance[/url]
[code] int current = this.listView1.SelectedIndices[0]; int next = current == this.listView1.Items.Count - 1 ? 0 : current + 1; this.listView1.Focus(); this.listView1.Items[next].Selected = true; this.listView1.Items[current].Selected = false; [/code] note: this will jump back to the first one when the last one was selected
[code] foreach (ListViewItem lvi in this.listViewFiles.CheckedItems) { // do whatever here string s = lvi.SubItems[3]; } [/code]
Hello, you should check out the value of list.SelectedItem in the debugger (yes, that simple :D), and see what it contains (i think i already told you that way to proceed in another thread ;))
What about having a look here: [url]http://www.yoda.arachsys.com/csharp/ebcdic/[/url] ?
Don't know if i understood exactly what you mean, but i guess you want to simulate the TAB button behaviour with the ENTER button, to do this you can do the following (might be buggy and inefficient because quickly tested): First you have to add keydown events to every control …
Hello, you cannot store unsigned integers in the registry, it only works for signed int's for the moment, this is a know .NET bug, however there's a workaround, see this link for more info and how to fix it: [url]http://support.microsoft.com/default.aspx?scid=kb;EN-US;317873[/url]
dude, did you finish the mp3 copier? :P
Hi in your timertick [code] Invalidate(); if (StartTime == 0) { timer1.Stop(); Invalidate(); // Beep PlaySound("ringin.wav", (IntPtr)0, 0); PlaySound("ringin.wav", (IntPtr)0, 0); } ConvertToTime(StartTime) //<- you forgot to put that in :) [/code]
[code] string[] files = Directory.GetFiles(sourceDirectoryName, "*.mp3"); [/code]
[QUOTE=Toulinwoek] String h = s + "/Help/MyHelpFile.chm"; [/QUOTE] shouldn't that be: [code] String h = s + @"\Help\MyHelpFile.chm"; [/code] ?
You can store it in the registry: [code] // Save data RegistryKey regKey = Registry.CurrentUser.CreateSubKey( "Software\\tayspen"); regKey.SetValue("Name", "Tayspen"); regKey.SetValue("Pass", "123456"); // Retrieve data String name = (String)regKey.GetValue("Name"); String pass = (String)regKey.GetValue("Pass"); if (name != null) { // Do whatever you want with the data here } if (pass != null) …
[code] // Creates a file called "test.txt" on the currently logged-in // user's desktop File.Create(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\testfile.txt"); // Or if you only want to find out the user that is currently logged in String userName = Environment.GetEnvironmentVariable("username"); [/code]
String s = Environment.GetEnvironmentVariable("windir");
[url]http://www.dotnet247.com/247reference/msgs/9/49583.aspx[/url] See the 2 answers in that thread
Tell them to update their xp to sp2 (if they run xp of course), its bundled with it! Any other OS shouldn't be used anyway :P
u need a global systemwide hotkey [url]http://www.webtropy.com/articles/art9-1.asp?f=RegisterHotKey[/url]
[URL]http://tinyurl.com/26euw[/URL] see there under 4. solution by netmaster
Application.ExecutablePath <-- Path + executable name Application.StartupPath <-- Only path
setw() equiv would be sth like this: String.Format("{0,10:D}", 2) : will format number 2 as a string of width 10 aligned to the right, use -10 to have it aligned on the left as for declaring the vars, you can do it like this: int[] a, b, c = new …
[code] #include <iostream> #include <stdlib.h> #include <string> #define ONE " via c++ string at() (worx only on 1 char): " #define MORE " via c++ string substr() (worx on more chars): " using namespace std; int main(void) { string test; do { cout << "Enter the teststring (6 chars minimum): …
after : MessageBox.Show("The passwords you chose do not match or text boxs are empty! Type the new password again", "Error"); write: return; instead of: Thread.CurrentThread.Start(); <--which doesnt do anything anyway in the snippet you pasted
just a quick 'n' dirty hack here :P [code] #include <iostream> #include <string> #include <math.h> using namespace std; int Bin2dec(string strBin) { int nSum = 0, k = strBin.length() - 1; for (int i = 0; i < strBin.length(); i++) nSum += (strBin[i] - '0') * pow(2, k--); return nSum; …
[code] for (int i = 0; i < rlen; i++) { printf("%x\n", fgetc(input)); } [/code] do it that way
[QUOTE] srand(time(NULL)); // I need Help here generating a number [/QUOTE] u have to #include <time.h> in order to make this work [QUOTE] if (guess_count == 0) cout <<"Sorry you used all your guesses \n "; // This doesn't work replay(); } [/QUOTE] First of all u forget a bracket, …
[code] #include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h> // for gettickcount, u could use time(NULL) aswell #define MAX 99 #define LEN 21 //add 1 for trailing 0 char int compare(const void *arg1, const void *arg2) { return stricmp((char*)arg1, (char*)arg2); } /* this getnames generates random chars and fills them …
The End.
r0ckbaer