|
You are my man! Thanks a lot, that was it! The Dispatcher... argh, of course.
|
|
|
|
|
|
Thank a lot, but Judah's post gave me already the answer I searched for. (And it was about the same as the German page was about)
|
|
|
|
|
I am wondering is there a way not to repaint/redrawn an item while scrolling up and down in listbox. I want to eliminate heavy repaint. I couldn't find any resource that to cache these items.
Thanks
|
|
|
|
|
owner draw them and just sometimes do nothing when the event is called
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Can you explain me a bit more i am painting in my own paint method but there is n't any event for scollingdown i can catch. Thanks for answering
|
|
|
|
|
hey can anyone can please help im new to c#, im trying to add a button to my program that will make a copy/backup of a file, the location of the orignal file is static so no need for dir listboxes. the problem i have is when it come to creating the copy.
private void button1_Click(object sender, EventArgs e)<br />
{<br />
folderBrowserDialog1.Description = "Select a Directory to Back up the Database";<br />
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)<br />
{<br />
System.IO.File.Copy("c:/test.txt", folderBrowserDialog1.SelectedPath + "UNKNOWN.txt", true);<br />
MessageBox.Show("File saved to " + folderBrowserDialog1.SelectedPath, "Backup Made", MessageBoxButtons.OK, MessageBoxIcon.Information);<br />
}
any help would be great
|
|
|
|
|
I'm not getting any syntax error, however the file isn't copying if SelectedPath doesn't have a slash at the end.
+ "/UNKNOWN.txt" is a quick fix but you'll be better off testing the last character of the SelectedPath and appending the slash so you don't end up with two slashes if a root folder is selected.
Dave
|
|
|
|
|
just seen that i missed the "/", what an idiot... cheers!
|
|
|
|
|
Hi,
I'm coding a Windows Service (using the Service Project in VS 2005) and in some occasions I would need to terminate in a clean way the service from inside of the code. In OnStart I create a worker thread, and I need this thread to, somehow, terminate the service. What is the best way to do it?
Thanks,
Federico
|
|
|
|
|
The following code is used to upload the wave(vox) file(without asp.net control) using c# .
Its IVR project.
Front end :voicexml
Back end :c# aspx
RecordAudio.cs
***************
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Web;
using System.IO;
namespace DMVEmergencyMessagesUtil
{
public class RecordAudio
{
UploadedFile upFile = new UploadedFile();
Stream s = null;
Stream sGetFileName = null;
Byte[] streamArray = null;
public void EquivalentConversion(string strFilePath, string strFileName, string strFileType, Stream s1)
{
s = s1; //HttpContext.Current.Request.InputStream;
string biData, sInputName, vDataBounds;
int nPosBegin, nPosEnd, nPos, nDataBoundPos, nPosFile, nPosBound;
char c = (char)13; //return key
byte[] bytArr = new byte[HttpContext.Current.Request.TotalBytes];
string strCheck = bytArr.GetValue(5).ToString();
biData = RequestInputStreamToString();
nPosBegin = 1;
nPosEnd = biData.IndexOf(c);
if (nPosEnd > 0)
{
}
if ((nPosEnd - nPosBegin) <= 0)
{
return;
}
vDataBounds = biData.Substring(nPosBegin, nPosEnd - nPosBegin);
nDataBoundPos = biData.IndexOf(vDataBounds, 1);
string sFileName = string.Empty;
string sFileNamePath = string.Empty;
string ContentType = string.Empty;
string tempdata = string.Empty;
do
{
nPos = biData.IndexOf("Content-Disposition", nDataBoundPos);
nPos = biData.IndexOf("name=", nPos);
nPosBegin = nPos + 6;
nPosEnd = biData.IndexOf((char)34, nPosBegin);
sInputName = biData.Substring(nPosBegin, nPosEnd - nPosBegin + 1);
nPosFile = biData.IndexOf("filename=", nDataBoundPos);
nPosBound = biData.IndexOf(vDataBounds, nPosEnd);
if (nPosFile != 0)//&& nPosFile < nPosBound)
{
nPosBegin = nPosFile + 10;
nPosEnd = biData.IndexOf((char)34, nPosBegin);
sFileName = biData.Substring(nPosBegin, nPosEnd - nPosBegin);
sFileNamePath = sFileName;
nPos = biData.IndexOf("Content-Type:", nPosEnd);
nPosBegin = nPos + 14;
nPosEnd = biData.IndexOf((char)13, nPosBegin);
upFile.ContentType = biData.Substring(nPosBegin, nPosEnd - nPosBegin);
ContentType = upFile.ContentType;
nPosBegin = nPosEnd + 4;
nPosEnd = biData.IndexOf(vDataBounds, nPosBegin) - 2;
upFile.setArrSize = nPosEnd - nPosBegin;
Array.Copy(streamArray, nPosBegin, upFile.m_fileDataNew, 0, nPosEnd - nPosBegin);
upFile.FileData = biData.Substring(nPosBegin, nPosEnd - nPosBegin);
upFile.FileName = strFileName;
upFile.FileType = strFileType;
string strPath = HttpContext.Current.Server.MapPath(strFilePath);
strPath = strPath + strFileName + strFileType;
upFile.SaveToDisk(strPath);
}
} while (nDataBoundPos == biData.IndexOf(vDataBounds + "--"));
}
public string RequestInputStreamToString()
{
StringBuilder sb = new StringBuilder();
int streamLength; int streamRead;
streamLength = Convert.ToInt32(s.Length); streamArray = new Byte[streamLength];
streamArray.ToString();
streamRead = s.Read(streamArray, 0, streamLength);
string test = System.Text.Encoding.Default.GetString(streamArray); for (int i = 0; i < streamLength; i++)
{
sb.Append(Convert.ToChar(streamArray[i]));
if (i == 150)
{
sb.ToString();
}
}
return sb.ToString();
}
}
}
UploadedFile.cs
***************
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.IO;
namespace DMVEmergencyMessagesUtil
{
public class UploadedFile
{
public UploadedFile()
{
//m_fileDataNew = new byte[arrLen];
}
public byte[] m_fileDataNew;
private string m_contentType, m_fileName, m_fileData,m_fileType;
public string ContentType
{
set
{
m_contentType = value;
}
get
{
return m_contentType;
}
}
public string FileType
{
set
{
m_fileType = value;
}
get
{
return m_fileType;
}
}
public Int32 setArrSize
{
set
{
m_fileDataNew = new byte[value];
}
}
public string FileName
{
set
{
m_fileName = value;
}
get
{
return m_fileName;
}
}
public string FileData
{
set
{
m_fileData = value;
}
get
{
return m_fileData;
}
}
public int getfileSize()
{
return FileData.Length;
}
public void SaveToDisk(string sPath)
{
if (sPath == string.Empty) return;
string MyString = FileData;
byte[] data = Encoding.Default.GetBytes(MyString);
FileStream fs = File.Create(sPath);
fs.Write(m_fileDataNew, 0, m_fileDataNew.Length);
fs.Close();
}
}
}
RecordMessage.aspx
*******************
]]>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
]]>
]]>
]]>
]]>
]]>
]]>
]]>
]]>
]]>
<block>
<return>
|
|
|
|
|
Great, and...?
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Great. Write an article. The forums are for asking questions, not for sharing your code.
only two letters away from being an asset
|
|
|
|
|
hello,
can someone know how to create a c# application based on a specific software architecture or diagrams.
for example if the developper try to create a class not included in the architecture diagram so he cannot.
tanks
dghdfghdfghdfghdgh
|
|
|
|
|
What is it you are trying to do? I can't really understand your English...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
hey if the architecture contain 2 classes so the developper cannot create in his project more than these 2 classes
dghdfghdfghdfghdgh
|
|
|
|
|
What are you talking about, how does creating class depends on architecture?!#@$? i dont understand!! did you mean class digram?
|
|
|
|
|
Oh I get what he's saying now. The answer to his question is 4.
Mark.
|
|
|
|
|
Actually - it's 42. Now all we need to do is build a bigger and better computer that asks the right question.
|
|
|
|
|
If you don't trust your developers, fire them and hire new ones
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Five bucks says you'll get the diagram wrong the first time anyway.
Then you'll be paying all your developers to sit around doing nothing while they wait for you to fix it.
|
|
|
|
|
ellllllllie wrote: dghdfghdfghdfghdgh
or maybe he needs to learn that randomly banging on a keyboard serves no useful purpose in software development
led mike
|
|
|
|
|
Thats what intellisense is for! It turns random banging into code
|
|
|
|
|
HAHAHHAA bad reply like you but funny.
If some one is old and don't know the new and the powerfull technologie don't say(it is better).
I mean if i have an uml diagram and i wanna to create the corrsponding code so i think that it is possible to limit my classes to the uml diagram maybe by creating this diagram in .net ....
so if someone know the right answer .... if not let his tangue inside his mouth
dghdfghdfghdfghdgh
|
|
|
|
|
does it a reference to learning logical data center for visual studio
dghdfghdfghdfghdgh
|
|
|
|