private void ProcessInfo()
{
string ffMPEG = System.IO.Path.Combine(Application.StartupPath, "ffMPEG.exe");
System.Diagnostics.Process mProcess = null;
System.IO.StreamReader SROutput = null;
string outPut = "";
string filepath = "D:\\source.mp4";
string param = string.Format("-i \"{0}\"", filepath);
System.Diagnostics.ProcessStartInfo oInfo = null;
System.Text.RegularExpressions.Regex re = null;
System.Text.RegularExpressions.Match m = null;
TimeSpan Duration = 0;
//Get ready with ProcessStartInfo
oInfo = new System.Diagnostics.ProcessStartInfo(ffMPEG, param);
oInfo.CreateNoWindow = true;
//ffMPEG uses StandardError for its output.
oInfo.RedirectStandardError = true;
oInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
oInfo.UseShellExecute = false;
// Lets start the process
mProcess …Run Code Online (Sandbox Code Playgroud) 使用@但仍然是错误:
有谁知道为什么这一行:
String[] values = Regex.Split(line, @",(?! [\w\d\.\[\]\(\)\#\*\-_])(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
Run Code Online (Sandbox Code Playgroud)
错误CS1002; 预期InsertLogtoDatabase D:\ MyProjects\InsertLogWindowsApp\WindowsFormsApplication1\LogOrderi2trade.cs 119
严重级代码说明项目文件行错误CS1003语法错误,','期望InsertLogtoDatabase D:\ MyProjects\InsertLogWindowsApp\WindowsFormsApplication1\LogOrderi2trade.cs 119
这是我得到的例外:
System.Runtime.InteropServices.COMException(0x800A03EC):来自HRESULT的异常:0x800A03EC
at System.RuntimeType.ForwardCallToInvokeMember(String memberName,BindingFlags flags,Object target,Int32 [] aWrapperTypes,MessageData&msgData)
at Microsoft.Office.Interop.Excel.Range.set_Formula(Object value)
我的代码看起来像这样:
Range rng = activeWorksheet.get_Range("A1");
rng.Formula = "=SUM(A4*C4;A5*C5;A6*C6;A7*C7)/SUM(A4:A7)";
Run Code Online (Sandbox Code Playgroud)
每当我运行此代码时,我都会得到前面提到的异常.但是,当我运行此代码时:
Range rng = activeWorksheet.get_Range("A1");
rng.Formula = "=SUM(A4:A7)/4"
Run Code Online (Sandbox Code Playgroud)
这非常有效.没有例外.
我检查了两个公式,它们在我的Excel中完美运行.我试过设置:
Application.Calculation = XlCalculation.xlCalculationAutomatic;
Run Code Online (Sandbox Code Playgroud)
这根本没有帮助,我一直在谷歌搜索这个解决方案,并没有找到任何有用的东西.有没有人知道可能有什么问题?
我想将字符串转换为int.我有像这样的字符串值"45,454,566.00".虽然类型转换抛出错误
输入字符串的格式不正确
int GrandTotalInWords = Int32.Parse(grandtotal);//error
grandTotalInWords.InnerHtml = ConvertNumbertoWords(GrandTotalInWords);
Run Code Online (Sandbox Code Playgroud) 我想将dd/MM/YYYY格式化的字符串日期转换为YYYY-MM-dd日期时间.但它回到我身边
"字符串未被识别为有效的DateTime."
如何将"04/26/2016"字符串转换为yyyy-MM-dd日期时间格式?
DateTime dt = DateTime.ParseExact("04/26/2016", "yyyy-MM-dd", CultureInfo.InvariantCulture);
Console.WriteLine(dt);
Run Code Online (Sandbox Code Playgroud) 我想将MM/YY格式化的字符串日期转换为mm-yy DateTime.并设置为rad蒙版编辑框的值.但它回到我身边
"字符串未被识别为有效的DateTime."
我试过了
DateTime dt = DateTime.ParseExact("11/17", "MMyy", CultureInfo.InvariantCulture);
Run Code Online (Sandbox Code Playgroud)
对于例如,我想转换03/16和radmasked编辑框的设定值伪装成MMyy如03-16
正在网上寻找计算增值税的方法,但似乎找不到。
decimal subTotal = FinalInvoice.Hold_Back_Value;
decimal VAT = //calculate vat at 20% for subtotal using helper method
decimal TOTAL = subtotal + VAT;
Run Code Online (Sandbox Code Playgroud) s = "delete MAX(id) from emp";
cmd = new SqlCommand(s, con);
cmd.ExecuteNonQuery();
GridView1.DataBind();
Run Code Online (Sandbox Code Playgroud)
错误:'('附近的语法不正确.
当我尝试在运行时错误显示上面执行此查询....enter code here
我正在尝试使用StreamWriter指定存储创建文件的位置:
string getCurrentPath = Environment.CurrentDirectory;
StreamWriter writeFile = new StreamWriter(@"" +getCurrentPath + "\\NDependProject\\OceanAPIDependencies.xml");
writeFile.Close();
Run Code Online (Sandbox Code Playgroud)
我收到此错误消息:
Run Code Online (Sandbox Code Playgroud)Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Project_Summer\ExtensionDirectoryTraversal\ExtensionDirectoryTr aversal\bin\Debug\NDependProject\OceanAPIDependencies.xml'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea n useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, …
我在我的应用程序中有登录页面,因为我已将我的指定ID保存在Cookies中
Response.Cookies["DesignationID"].Value = ds.Tables[0].Rows[0]["DesignationID"].ToString();
Run Code Online (Sandbox Code Playgroud)
在用户登录之后在另一个页面中我想要检索该cookie值,所以我编写了类似的代码
if (Convert.ToInt32(Request.Cookies["DesignationID"].Value = 2))
Run Code Online (Sandbox Code Playgroud)
但它显示错误,如不能隐式将类型'int'转换为'string'c#,红色虚线在2以下...所以请给我一些提示......