|
could show me a snippet please.
|
|
|
|
|
Hi,
I am getting this error There is an error in XML document (1, 2) When i Deserialize following Xml.
<EnvironmentConfigurations>
<EnvironmentConfiguration>
<EnvironmentName>ABC</EnvironmentName>
<CMSConfiguration>
<Address>net.tcp://localhost:9000/Manager</Address>
<Binding>netTcpBinding</Binding>
<Contract>Common.Interfaces.Server</Contract>
</CMSConfiguration>
</EnvironmentConfiguration>
<EnvironmentConfiguration>
<EnvironmentName>XYZ</EnvironmentName>
<CMSConfiguration>
<Address>net.tcp://localhost:9000/Manager</Address>
<Binding>netTcpBinding</Binding>
<Contract>Common.Interfaces.Server</Contract>
</CMSConfiguration>
</EnvironmentConfiguration>
</EnvironmentConfigurations>
|
|
|
|
|
The exception you are receiving has an InnerException property, it should tell you what the problem is.
|
|
|
|
|
The first line should be something like
<?xml version="1.0" encoding="utf-8" ?>
The second character of the first line must be a question mark, and that's the position shown in the error message.
Obvioulsy, you've somehow lost your first line.
|
|
|
|
|
hii everyone,
Iam working on TabletPC handwriting synthesis
iam using MICROSOFT.INK SDK
i want to erase specific portion of the ink dynamically
example : i write CAR using my handwriting , I want to erase the alphabet C,R and want to get specific portion of A only
please help me out , how can i erase defined specific portion dynamically without using INK ERASEMODE/DELETE MODE functionality (of stroke selection first den use erase mode), I dont want to do it manually after selection and den usong delete mode
I want to do it Programatically
please help me out
with regards
Amit
|
|
|
|
|
Hi All,
Can any one say about " predicate delegate " in c#....
Please suggest me good example.Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
|
Kevin
|
|
|
|
|
Hi all,
I have one text file. now i want to check who has taken the handle of the text file.
How can i find the exe in C#?
Reply ASAP.
Thanking You,
Sunil G.modified on Tuesday, February 23, 2010 2:10 AM
|
|
|
|
|
To retrieve a list of running processes use: System.Diagnostics.Process.GetProcesses() which returns an array av Process objects.
|
|
|
|
|
with this System.Diagnostics.Process.GetProcesses() i get all the running processes.
but i want the process name who has taken the handle of particular text file.
As in input parameter i will give textfile name and want the process who has taken the handle of the textfile.modified on Tuesday, February 23, 2010 3:35 AM
|
|
|
|
|
Do you have the name of the text file and you want to retrieve the process which has the handle to that file? Could you please elaborate more?
|
|
|
|
|
Yes you r on the track.
I have the name of the text file and I want to retrieve the process which has the handle to that file..
If you want more explanation, i will explain the whole case.
Thanking You,
Sunil G.modified on Tuesday, February 23, 2010 3:46 AM
|
|
|
|
|
I'm sorry Sunil - don't know how to achieve that. Hope someone else can help, and I'l make a post if I have a sudden stroke of genious.. Good luck anyway!
|
|
|
|
|
Hi
Check this out it might help you..i hav'nt tried it but looks like this is what you are looking for..
fpound this solution while going thrw some blog
posted by :-Gennady Zabrodsky
It is very complex way to invoke Win32 from C#.
You should use tool Handle.exe from http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx
After that your C# code have to be the following:
string fileName = @"c:\aaa.doc";//Path to locked file
Process tool = new Process();
tool.StartInfo.FileName = "handle.exe";
tool.StartInfo.Arguments = fileName;
tool.StartInfo.UseShellExecute = false;
tool.StartInfo.RedirectStandardOutput = true;
tool.Start();
tool.WaitForExit();
string outputTool = tool.StandardOutput.ReadToEnd();
string matchPattern = @"(?<=\s+pid:\s+)\b(\d+)\b(?=\s+)";
foreach(Match match in Regex.Matches(outputTool, matchPattern))
{
Process.GetProcessById(int.Parse(match.Value)).Kill();
}
|
|
|
|
|
|
|
Hi I've been working on making a quadrilateral image distortion algorithm and I have managed to make it distort any image into the shape specified but I cant manage to work out how to apply even bilinear interpolation. I would like some help if anyone can, to add interpolation to my algorithm. I have included the distortion code below:
private Bitmap DistortImage(Image sourceImage,Point TopLeft, Point TopRight, Point BottomLeft, Point BottomRight)
{
int width, height;
width = Convert.ToInt32(Math.Max(p2.X, p4.X));
height = Convert.ToInt32(Math.Max(p3.Y, p4.Y));
Bitmap dest = new Bitmap(width, height);
Bitmap src = new Bitmap(sourceImage);
for (int yStart = TopLeft.Y; yStart < BottomLeft.Y; yStart++)
{
double xStart = TopLeft.X + (((double)(yStart - TopLeft.Y) / (double)(BottomLeft.Y - TopLeft.Y) * (BottomLeft.X - TopLeft.X)));
double yEnd = TopRight.Y + ((double)(yStart - TopLeft.Y) / (double)(BottomLeft.Y - TopLeft.Y)) * (BottomRight.Y - TopRight.Y);
double xEnd = TopRight.X + (((double)(yEnd - TopRight.Y) / (double)(BottomRight.Y - TopRight.Y) * (BottomRight.X - TopRight.X)));
double xScale = (xEnd - xStart) / (double)src.Width;
for (double x = xStart; x < xEnd; x+= xScale)
{
double y = yStart + (((double)(x - xStart) / (double)(xEnd - xStart) * (yEnd - yStart)));
double yScale = ((double)(x - xStart) / (double)(xEnd - xStart)) / ((double)(BottomLeft.Y - TopLeft.Y) / (double)(BottomRight.Y - TopRight.Y));
double ySrc = ((double)(yStart - TopLeft.Y) / (double)(BottomLeft.Y - TopLeft.Y)) * src.Height;
double xSrc = ((double)(x - xStart) / (double)(xEnd - xStart)) * src.Width;
int xNumPixels, yNumPixels;
xNumPixels = Convert.ToInt32(Math.Ceiling(xScale));
yNumPixels = Convert.ToInt32(Math.Ceiling(yScale));
int yNumPixelsAbove;
yNumPixelsAbove = Convert.ToInt32(Math.Ceiling(yNumPixels / 2d));
if (xSrc < 0)
xSrc = 0;
if (ySrc < 0)
ySrc = 0;
Color col = src.GetPixel(Convert.ToInt32(Math.Floor(xSrc)), Convert.ToInt32(Math.Floor(ySrc)));
for (int sx = Convert.ToInt32(Math.Floor(x)); sx < Convert.ToInt32(Math.Floor(x)) + xNumPixels; sx++)
{
if (sx < width)
{
for (int sy = Convert.ToInt32(Math.Floor(y)) - yNumPixelsAbove; sy < Convert.ToInt32(Math.Floor(y)) + yNumPixels; sy++)
{
if (sy >= 0 && sy < height)
dest.SetPixel(sx, sy, col);
}
}
}
}
}
src.Dispose();
src = null;
return dest;
}
Thanks in advance to anyone who can help"I'm very good at multitasking. I can completely ignore you and do this at the same time"
|
|
|
|
|
This is not the speedy solution.
You are mapping your src pixels to your dest pixels. Instead of skipping pixels, just walk through each dest pixel and figure out a double for src x and y. The fractional part of the x and y can be used for weighting your source pixels - bi-linear.
int xSrcIdx = (float)Math.Floor(xSrc);
float xFrac = xSrc - xSrcIdx;
int ySrcIdx = (float)Math.Floor(ySrc);
float yFrac = ySrc - ySrcIdx;
Color c00 = src.GetPixel(xSrcIdx, ySrcIdx);
Color c01 = src.GetPixel(xSrcIdx, ySrcIdx+1);
Color c10 = src.GetPixel(xSrcIdx+1, ySrcIdx);
Color c11 = src.GetPixel(xSrcIdx+1, ySrcIdx+1);
Color c0 = InterpretColor(c00,c01,yFrac);
Color c1 = InterpretColor(c10,c11,yFrac);
Color c = InterpretColor(c0 ,c1 ,xFrac);
dest.SetPixel(Convert.ToInt32(Math.Floor(x)), Convert.ToInt32(Math.Floor(y)), col);
Where InterpretColor(Color c1, Color c2, float frac) returns a linear interpolation between c1 and c2. This will give you some of the smoothing you want. The problem is that when the delta between source pixels >> 1, you start getting visual anomalies, and might want to have another method that combines multiple (> 2x2) pixels back into the dest.Opacity, the new Transparency.
|
|
|
|
|
Thank you for that. Hopefully this will help get me the solution that im after.
Thanks again"I'm very good at multitasking. I can completely ignore that and do this at the same time"
|
|
|
|
|
I compile my form But view warning error
the error message is:Child list for field tblmembers cannot be created
My form Code is:
using System;
using System.Collections.Generic;
using System.Data.OleDb;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using DevComponents.DotNetBar.Rendering;
namespace Library_Project
{
public partial class ViewInfo : Form
{
public ViewInfo()
{
InitializeComponent();
}
private void ViewInfo_Load(object sender, EventArgs e)
{
DataSet dsDataMember = null;
memberBL thisMember = new memberBL();
dsDataMember = thisMember.View();
dataGridViewX1.DataBindings.Add(new Binding("DataSource", dsDataMember, "tblmembers"));
dataGridViewX1.Columns[0].HeaderText = "کد عضو";
dataGridViewX1.Columns[1].HeaderText = "نام عضو";
dataGridViewX1.Columns[2].HeaderText = "نام خانوادگی";
dataGridViewX1.Columns[3].HeaderText = "شماره شناسنامه";
dataGridViewX1.Columns[4].HeaderText = "کد ملی";
dataGridViewX1.Columns[5].HeaderText = "تاریخ تولد";
dataGridViewX1.Columns[6].HeaderText = "شغل";
dataGridViewX1.Columns[7].HeaderText = "تلفن";
dataGridViewX1.Columns[8].HeaderText = "موبایل";
dataGridViewX1.Columns[9].HeaderText = "ادرس";
dataGridViewX1.Columns[10].HeaderText = "تاریخ عضویت";
DataSet dsDataBook = null;
bookBL thisBook = new bookBL();
dsDataBook = thisBook.View();
dataGridViewX2.DataBindings.Add(new Binding("DataSource", dsDataBook, "tblbooks"));
dataGridViewX2.Columns[0].HeaderText = "کد کتاب";
dataGridViewX2.Columns[1].HeaderText = "نام کتاب";
dataGridViewX2.Columns[2].HeaderText = "ناشر";
dataGridViewX2.Columns[3].HeaderText = "مترجم";
dataGridViewX2.Columns[4].HeaderText = "شابک";
dataGridViewX2.Columns[5].HeaderText = "موضوع";
try
{
textBox1.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.membercode"));
textBox2.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.name"));
textBox3.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.family"));
textBox4.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.shsh"));
textBox5.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.melicode"));
textBox6.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.tavalod"));
textBox7.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.shoghl"));
textBox8.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.tel"));
textBox9.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.mobile"));
textBox10.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.adr"));
textBox11.DataBindings.Add(new Binding("Text", dsDataMember, "tblmembers.trkhozv"));
}
catch (Exception err)
{
MessageBox.Show(err.Message.ToString());
}
try
{
textBox12.DataBindings.Add(new Binding("Text", dsDataBook, "tblmembers.codebook"));
textBox13.DataBindings.Add(new Binding("Text", dsDataBook, "tblmembers.bookname"));
textBox14.DataBindings.Add(new Binding("Text", dsDataBook, "tblmembers.nasher"));
textBox15.DataBindings.Add(new Binding("Text", dsDataBook, "tblmembers.motarjem"));
textBox16.DataBindings.Add(new Binding("Text", dsDataBook, "tblmembers.shabok"));
textBox17.DataBindings.Add(new Binding("Text", dsDataBook, "tblmembers.mozo"));
}
catch (Exception err)
{
MessageBox.Show(err.Message.ToString());
}
}
private void dataGridViewX1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
textBox1.Text = dataGridViewX1.CurrentRow.Cells[0].Value.ToString();
textBox2.Text = dataGridViewX1.CurrentRow.Cells[1].Value.ToString();
textBox3.Text = dataGridViewX1.CurrentRow.Cells[2].Value.ToString();
textBox4.Text = dataGridViewX1.CurrentRow.Cells[3].Value.ToString();
textBox5.Text = dataGridViewX1.CurrentRow.Cells[4].Value.ToString();
textBox6.Text = dataGridViewX1.CurrentRow.Cells[5].Value.ToString();
textBox7.Text = dataGridViewX1.CurrentRow.Cells[6].Value.ToString();
textBox8.Text = dataGridViewX1.CurrentRow.Cells[7].Value.ToString();
textBox9.Text = dataGridViewX1.CurrentRow.Cells[8].Value.ToString();
textBox10.Text = dataGridViewX1.CurrentRow.Cells[9].Value.ToString();
}
}
}
What is the Problem?
|
|
|
|
|
Do you need to add the schema to the Binding parameter, "mySchema.tblmembers" I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Does anyone know how to insert a Hyperlink into a mail message sent through SMTPClient. I am able to send www.asdf.com within the body of the email, but when I open up my test email, it doesn't show up as a hyperlink.
thank you!
-matt
|
|
|
|
|
You'll need to create a HTML email and insert the hyperlink as usual in there:
<a href="http://www.adsf.com">adsf</a>
|
|
|
|
|
I think that depends mainly on what you are using to view the email with. Some show anything that looks like a web address as a link, some allow html, others not.
What are you using to view the email with and does it work on other URL?CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|