|
I think you are right.
Did any one know that:
Is SnagIt Providing the ways of Loading as a DLL?
And, How can I load SnagIt as a DLL from my code?
|
|
|
|
|
The executable has to be specially written to provide such functionality. You cannot load just any .EXE you want as a library.
|
|
|
|
|
I have a Format8bppIndexed image . I tried to modify the palette using the below code.
ColorPalette pal = bitmapImage.Palette;
for (int i = 0; i < pal.Entries.Length/2; i++)
pal.Entries[i] = Color.FromArgb(255, 255, 255);
bitmapImage.Palette = pal;
but the somehow this change in palette does not affect on the image when i save the Image using
bitmapImage.Save("filepath");
How do I make the change in palette affect the image.
|
|
|
|
|
|
We have a web service which is deployed which is beyond Microsoft TMG. If I try to POST the SOAP data using HttpRequest I am able to get the response. The problem is I am unable to access the same though the client accessing the web service (I believe the TMG is rejecting). I tried the below steps to pass the authentication
1) Passing credentials using Network Credentials
2) Passing Credential Cache using BASIC authentication
3) But trying to post the HTTP using Fiddler it works.
Is there any option that I can get the response back to client from web service.
Thanks In Advance
|
|
|
|
|
I need to do the following:
1) Get a list of my friends from Facebook.
2) Pick one and send a message
I will be doing this in a Metro app. I have zero experience with Facebook. Can someone point me in the right direction?
Thanks
Everything makes sense in someone's mind
|
|
|
|
|
Start here[^].
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Hello,
Win 7 - 64-bit Windows Form App
Did a clean and rebuild on the sln but the program crashes on the StreamReader line. The file is definitely there and in the correct place. Anything wrong with this call?
public static class BOBroker
{
public static string GetClassDefsXml()
{
StreamReader classDefStream = new StreamReader(
typeof(BOBroker).Assembly.GetManifestResourceStream("WCM.BO.ClassDefs.xml"));
string _classDefsXML = classDefStream.ReadToEnd();
classDefStream.Close();
return _classDefsXML;
}
Thanks, DKH
|
|
|
|
|
what is the error?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Furthermore, I don't understand why people tend to code several lines to read all of a text file, when there is a single-line solution in
string allTheFilesText=File.ReadAllText(path);
|
|
|
|
|
Luc Pattyn wrote: I don't understand why people tend to code several lines to read all of a text file
With respect, Luc, you once admonished a poster that he was supposed use a loop to read all of a file because "that's what streams are for."
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I'm all in favor of streaming data, especially when the amount of data can be large and there really is no need to have it all in memory at once; streaming then means having an explicit loop of input-process-output, dealing with a fraction of the data at a time.
When the amount of data is known to be really small, or there is a need to have it all at once, then one can rightfully decide not to stream, and to read or write all in one go; but then I insist on taking the easiest way to do that, which is by using a single File method.
Using a stream class to not stream the data just does not make any sense. StreamReader.ReadToEnd() gets abused over and over, almost as much as String.ToString() .
|
|
|
|
|
It's a resource, not a file, in this case.
|
|
|
|
|
My mistake, sorry.
|
|
|
|
|
Have you added the file to the project as an embedded resource?
Best regards
|
|
|
|
|
By
stylesmylez
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace SplitFile
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private String _sPLITe = null;
//private SaveFileDialog sPLITeFM;
private void btnSplit_Click(object sender, EventArgs e)
{
//statusBar.Text = DateTime.Today;
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "Open Photo";
dlg.Filter = "Windows Bitmap Files (*.bmp)|*.bmp"
+ "|All files (*.*)|*.*";
if (dlg.ShowDialog() == DialogResult.OK)
{
try
{
//pbxPhoto.Image = new Bitmap(dlg.OpenFile());
_sPLITe = dlg.FileName;
Split300DividedbyLenthorSizeOfFile(_sPLITe);
}
catch (Exception ex)
{
MessageBox.Show("Unable to load file: " + ex.Message);
}
}
dlg.Dispose();
}
private void Split300DividedbyLenthorSizeOfFile(string inputFile)
{
//string inputFile = txtInputFile.Text; // Substitute this with your Input File
FileStream fs = new FileStream(inputFile, FileMode.Open, FileAccess.Read);
//int numberOfFilesx = Convert.ToInt32(txtChunks.Text);
//int sizeOfEachFilex = (int)Math.Ceiling((double)fs.Length);
//txtChunks.Text= string txtChunksx;
////new byte [(int)fs.Length / 300000000]);
//int numberOfFilexs =
// (Convert.ToInt32(fs.Length / 1500000));
//int numberOfFiles = Convert.ToInt32(txtChunks.Text);
int sizeOfEachFile =
(int)Math.Ceiling((double)
fs.Length /
//Devided By inserted Peace to get Amount example 3000/1500=2
(Convert.ToInt32(fs.Length / 1500000)));
for (int i = 1; i <=
//Devided By inserted Peace MB to get Amount. example 3000/1500=2
(Convert.ToInt32(fs.Length / 1500000))
; i++)
{
string baseFileName = Path.GetFileNameWithoutExtension(inputFile);
string extension = Path.GetExtension(inputFile);
FileStream outputFile = new FileStream(Path.GetDirectoryName(inputFile) + "\\" + baseFileName + "." + i.ToString().PadLeft(5, Convert.ToChar("0")) + extension + ".tmp", FileMode.Create, FileAccess.Write);
int bytesRead = 0;
byte[] buffer = new byte[sizeOfEachFile];
if ((bytesRead = fs.Read(buffer, 0, sizeOfEachFile)) > 0)
{
outputFile.Write(buffer, 0, bytesRead);
}
outputFile.Close();
}
fs.Close();
}
private void Merge300DividedbyLenthorSizeOfFile(string outPath)
{
//string outPath = txtInputFolder.Text; // Substitute this with your Input Folder
string[] tmpFiles = Directory.GetFiles(outPath, "*.tmp");
FileStream outputFile = null;
string prevFileName = "";
foreach (string tempFile in tmpFiles)
{
string fileName = Path.GetFileNameWithoutExtension(tempFile);
string baseFileName = fileName.Substring(0, fileName.IndexOf(Convert.ToChar(".")));
string extension = Path.GetExtension(fileName);
if (!prevFileName.Equals(baseFileName))
{
if (outputFile != null)
{
outputFile.Flush();
outputFile.Close();
}
outputFile = new FileStream(outPath + baseFileName + extension, FileMode.OpenOrCreate, FileAccess.Write);
}
int bytesRead = 0;
byte[] buffer = new byte[1024];
FileStream inputTempFile = new FileStream(tempFile, FileMode.OpenOrCreate, FileAccess.Read);
while ((bytesRead = inputTempFile.Read(buffer, 0, 1024)) > 0)
outputFile.Write(buffer, 0, bytesRead);
inputTempFile.Close();
File.Delete(tempFile);
prevFileName = baseFileName;
}
outputFile.Close();
}
private void btnMerge_Click(object sender, EventArgs e)
{
//statusBar.Text = DateTime.Today;
FolderBrowserDialog dlg = new FolderBrowserDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
try
{
//pbxPhoto.Image = new Bitmap(dlg.OpenFile());
//_sPLITe = dlg.FileName;
_sPLITe = dlg.SelectedPath;
Merge300DividedbyLenthorSizeOfFile(_sPLITe);
}
catch (Exception ex)
{
MessageBox.Show("Unable to load file: " + ex.Message);
}
}
}
}
}
<pre lang="vb">By
stylesmylez</pre>
|
|
|
|
|
Is there a question mixed in there somewhere?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
what is that soposto mean??
That C# code is for those who want to create split file app jst copy n paste n modify put in buttons etc.
At one point i needed one so i put this out for those who where in my position!!!!!
|
|
|
|
|
stylez500 wrote: i put this out for those who
Then write an article instead of posting code in forums where questions are asked...
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
It's "supposed". TXTSPEAK is heavily frowed upon here as it makes you look childish.
|
|
|
|
|
stylez500 wrote: That C# code is for those who want to create split file app jst copy n paste n
modify put in buttons etc. At one point i needed one so i put this
out for those who where in my position!!!!!
OK, great. The problem you didn't consider is that the forums fill up so fast nobody will see your code by the end of next week because it'll be buried by a dozen pages of forum posts.
Yeah and don't think "Oh it'll still be visible because of Google." Think again. If everyone used Google people would be finding their own answers instead of relying on the regulars here to spoon-feed them answers.
|
|
|
|
|
It's just a shame that you ignored the tips and tricks, and articles sections where this would have ben much better received.
|
|
|
|
|
Homework?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
what is that soposto mean??
That C# code is for those who want to create split file app jst copy n paste n modify put in buttons etc.
At one point i needed one so i put this out for those who where in my position!!!!!
|
|
|
|
|
If you look at the very first item in this forum, it says "How to ask a question". This forum is for asking questions. So when you post something like that, we are left wondering what the questions is. In any case, you could have been more clear by stating that you're not asking a question(which the purpose of the forum) but posting a solution to a problem you encountered. Nonetheless, thanks for sharing.
|
|
|
|